github.com/jxskiss/gopkg/v2@v2.14.9-0.20240514120614-899f3e7952b4/internal/linkname/reflect.go (about) 1 package linkname 2 3 import ( 4 "unsafe" 5 6 "github.com/jxskiss/gopkg/v2/internal/unsafeheader" 7 ) 8 9 func Reflect_typelinks() ([]unsafe.Pointer, [][]int32) { 10 return reflect_typelinks() 11 } 12 13 func Reflect_resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer { 14 return reflect_resolveTypeOff(rtype, off) 15 } 16 17 func Reflect_ifaceIndir(rtype unsafe.Pointer) bool { 18 return reflect_ifaceIndir(rtype) 19 } 20 21 func Reflect_unsafe_New(rtype unsafe.Pointer) unsafe.Pointer { 22 return reflect_unsafe_New(rtype) 23 } 24 25 func Reflect_unsafe_NewArray(elemRType unsafe.Pointer, capacity int) unsafe.Pointer { 26 return reflect_unsafe_NewArray(elemRType, capacity) 27 } 28 29 // Reflect_typedmemmove copies a value of type t to dst from src. 30 func Reflect_typedmemmove(rtype unsafe.Pointer, dst, src unsafe.Pointer) { 31 reflect_typedmemmove(rtype, dst, src) 32 } 33 34 // Reflect_typedslicecopy copies a slice of elemType values from src to dst, 35 // returning the number of elements copied. 36 func Reflect_typedslicecopy(elemRType unsafe.Pointer, dst, src unsafeheader.SliceHeader) int { 37 return reflect_typedslicecopy(elemRType, dst, src) 38 } 39 40 func Reflect_maplen(m unsafe.Pointer) int { 41 return reflect_maplen(m) 42 } 43 44 //go:linkname reflect_typelinks reflect.typelinks 45 func reflect_typelinks() ([]unsafe.Pointer, [][]int32) 46 47 //go:linkname reflect_resolveTypeOff reflect.resolveTypeOff 48 func reflect_resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer 49 50 //go:linkname reflect_ifaceIndir reflect.ifaceIndir 51 //go:noescape 52 func reflect_ifaceIndir(rtype unsafe.Pointer) bool 53 54 //go:linkname reflect_unsafe_New reflect.unsafe_New 55 func reflect_unsafe_New(unsafe.Pointer) unsafe.Pointer 56 57 //go:linkname reflect_unsafe_NewArray reflect.unsafe_NewArray 58 func reflect_unsafe_NewArray(unsafe.Pointer, int) unsafe.Pointer 59 60 //go:linkname reflect_typedmemmove reflect.typedmemmove 61 //go:noescape 62 func reflect_typedmemmove(t unsafe.Pointer, dst, src unsafe.Pointer) 63 64 //go:linkname reflect_typedslicecopy reflect.typedslicecopy 65 //go:noescape 66 func reflect_typedslicecopy(elemRType unsafe.Pointer, dst, src unsafeheader.SliceHeader) int 67 68 //go:linkname reflect_maplen reflect.maplen 69 //go:noescape 70 func reflect_maplen(m unsafe.Pointer) int