Documentation ¶
Index ¶
- func AssignSlice2StringUnsafe(b []byte) (s string)
- func AssignString2SliceUnsafe(sp *string) (b []byte)
- func AssignString2SliceUnsafeRough(sp *string) []byte
- func GetStringDataPointer(sp *string) uintptr
- func GetStringHeader(sp *string) *reflect.StringHeader
- func NoEscape(p unsafe.Pointer) unsafe.Pointer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssignString2SliceUnsafe ¶
SEE go api runtime slicebytetostringtmp
NOTE go compiler generate shortest code for `*string` arg type (at least for go1.13)
func AssignString2SliceUnsafeRough ¶
shorter and better for inlining version of AssignString2SliceUnsafe, but without Cap explicit initialization (cap(result) is undefined garbage) should be used with additional care
NOTE go compiler generate shortest code for `*string` arg type (at least for go1.13)
func GetStringHeader ¶
func GetStringHeader(sp *string) *reflect.StringHeader
from runtime/string.go:stringStructOf inlined
func NoEscape ¶
Hides pointer from the compiler escape analysis The most dangerous function in file, SHOULD BE USED WITH EXTREME CAREFULLY
In fact it is copy of go src\runtime\stubs.go:noescape() under exported name
USAGE (*TypeT)(xruntime.NoEscape(unsafe.Pointer(&valueOfTypeT))) NOTE can't simply use go:linkname due to loss of inlining
inlined ~go:noescape
Types ¶
This section is empty.