github.com/primecitizens/pcz/std@v0.2.1/builtin/const/sizes.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright 2023 The Prime Citizens
     3  
     4  package stdconst
     5  
     6  import "unsafe"
     7  
     8  const (
     9  	SizeStringType = unsafe.Sizeof(string(""))
    10  	SizeSliceType  = unsafe.Sizeof([]byte(nil))
    11  	SizeEfaceType  = unsafe.Sizeof(any((*byte)(nil)))
    12  	SizeIfaceType  = unsafe.Sizeof(iface((*ifaceImpl)(nil)))
    13  
    14  	SizePointer       = unsafe.Sizeof((*byte)(nil))
    15  	SizeFunc          = unsafe.Sizeof(fn)
    16  	SizeUnsafePointer = unsafe.Sizeof(unsafe.Pointer(nil))
    17  
    18  	SizeUintType    = unsafe.Sizeof(uint(0))
    19  	SizeUint8Type   = unsafe.Sizeof(uint8(0))
    20  	SizeUint16Type  = unsafe.Sizeof(uint16(0))
    21  	SizeUint32Type  = unsafe.Sizeof(uint32(0))
    22  	SizeUint64Type  = unsafe.Sizeof(uint64(0))
    23  	SizeUintptrType = unsafe.Sizeof(uintptr(0))
    24  
    25  	SizeIntType   = unsafe.Sizeof(int(0))
    26  	SizeInt8Type  = unsafe.Sizeof(int8(0))
    27  	SizeInt16Type = unsafe.Sizeof(int16(0))
    28  	SizeInt32Type = unsafe.Sizeof(int32(0))
    29  	SizeInt64Type = unsafe.Sizeof(int64(0))
    30  
    31  	SizeFloat32Type = unsafe.Sizeof(float32(0))
    32  	SizeFloat64Type = unsafe.Sizeof(float64(0))
    33  
    34  	SizeComplex64Type  = unsafe.Sizeof(complex64(0))
    35  	SizeComplex128Type = unsafe.Sizeof(complex128(0))
    36  )
    37  
    38  type iface interface{ isiface() }
    39  
    40  type ifaceImpl struct{}
    41  
    42  func (*ifaceImpl) isiface() {}
    43  
    44  func fn() {}