Documentation
¶
Index ¶
- Constants
- Variables
- func Compare8(a, b unsafe.Pointer) int
- func Compare16(a, b unsafe.Pointer) int
- func Compare32(a, b unsafe.Pointer) int
- func Compare64(a, b unsafe.Pointer) int
- func Compare128(a, b unsafe.Pointer) int
- func Eface2Interface(eface Eface) interface{}
- func GetCompare(a, b unsafe.Pointer, size uintptr) func(a, b unsafe.Pointer) int
- func IsDirectIface(t *Type) bool
- func Noescape(p unsafe.Pointer) unsafe.Pointer
- func NoescapeInterface(x interface{}) interface{}
- func UnsafeAlloc(size uintptr) unsafe.Pointer
- type Eface
- type Iface
- type Slice
- type String
- type Type
Constants ¶
View Source
const ( KindBool = 1 + iota KindInt KindInt8 KindInt16 KindInt32 KindInt64 KindUint KindUint8 KindUint16 KindUint32 KindUint64 KindUintptr KindFloat32 KindFloat64 KindComplex64 KindComplex128 KindArray KindChan KindFunc KindInterface KindMap KindPtr // 指针 KindSlice KindString KindStruct KindUnsafePointer KindDirectIface = 1 << 5 //结构体只含一个指针/普通指针/unsafe.Pointer 总结: 值为直接指针 KindGCProg = 1 << 6 KindNoPointers = 1 << 7 // int/float/complex/不含指针的struct/int array/float array 等 总结: 值完全不含指针 KindMask = (1 << 5) - 1 )
Variables ¶
View Source
var ( TypeInt = TypeOf(int(1)) TypeString = TypeOf(string("")) )
Functions ¶
func Compare128 ¶
func Eface2Interface ¶
func Eface2Interface(eface Eface) interface{}
func IsDirectIface ¶
IsDirectIface reports whether t is stored directly in an interface value.
func Noescape ¶
copy from package runtime noescape hides a pointer from escape analysis. noescape is the identity function but escape analysis doesn't think the output depends on the input. noescape is inlined and currently compiles down to zero instructions. USE CAREFULLY!
func NoescapeInterface ¶
func NoescapeInterface(x interface{}) interface{}
func UnsafeAlloc ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.