Documentation
¶
Index ¶
- func Cast[T any](ptr uintptr) *T
- func CastNative[N Native, T Native](ptr *N) *T
- func CastWithOffset[T any](ptr uintptr, offset uint64) *T
- func Cstring(pinner *runtime.Pinner, name string) *byte
- func Gostring(ptr *byte) string
- func GostringSized(ptr *byte, size uint64) string
- func NativeToUintptr[T any](x T) uintptr
- func PtrToUintptr[T any](arg *T) uintptr
- func Slice[T any](ptr *T, length uint64) []T
- func SliceData[E any, T ~[]E](slice T) *E
- func SliceToUintptr[T any](arg []T) uintptr
- func String(ptr *byte, length uint64) string
- func StringData(str string) *byte
- func UintptrToNative[T any](x uintptr) T
- type Native
- type Pointer
- type StringHeader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cast ¶
Cast is used to centralize unsafe use C of allocated pointer. We take the address and then dereference it to trick go vet from creating a possible misuse of unsafe.Pointer
func CastNative ¶
func CastWithOffset ¶
CastWithOffset is the same as cast but adding an offset to the pointer by a multiple of the size of the type pointed.
func GostringSized ¶
func NativeToUintptr ¶
NativeToUintptr is a helper used by populate WafObject values with Go values
func PtrToUintptr ¶
PtrToUintptr is a helper to centralize of usage of unsafe.Pointer do not use this function to cast interfaces
func SliceToUintptr ¶
func StringData ¶ added in v4.2.0
func UintptrToNative ¶
UintToNative is a helper used retrieve Go values from an uintptr encoded value from a WafObject
Types ¶
type StringHeader ¶
func NativeStringUnwrap ¶
func NativeStringUnwrap(str string) StringHeader
NativeStringUnwrap cast a native string type into it's runtime value.
Click to show internal directories.
Click to hide internal directories.