Documentation
¶
Index ¶
- func AllocateSliceSpaceAndBind(p unsafe.Pointer, length uint64, typ reflect.Type) unsafe.Pointer
- func AllocateSpace(p unsafe.Pointer, typ reflect.Type) unsafe.Pointer
- func BytesAllocFn(p unsafe.Pointer, length uint64) unsafe.Pointer
- func IfacePtrToPtr(val *interface{}) unsafe.Pointer
- type AllocationFn
- type SliceAllocationFn
- type SliceHeader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllocateSliceSpaceAndBind ¶
Allocates a new slice of the given length, of the given type. Note: p is assumed to be a pointer to a slice header, and the pointer is assumed to keep the referenced data alive as long as necessary, away from the GC. The allocated space is zeroed out.
func AllocateSpace ¶
Allocates space of the given length and returns a pointer to the contents The allocated space is zeroed out.
func IfacePtrToPtr ¶
Types ¶
type SliceAllocationFn ¶
func MakeSliceAllocFn ¶
func MakeSliceAllocFn(typ reflect.Type) SliceAllocationFn
func (SliceAllocationFn) MutateLenOrAllocNew ¶ added in v0.1.5
Checks the capacity of the slice first. If sufficient, it mutates the length and returns the pointer to the contents. If not sufficient, it allocates a new slice using the underlying allocation function, and returns the pointer to the new contents.
type SliceHeader ¶
func GetSliceHeader ¶
func GetSliceHeader(p unsafe.Pointer, length uint64) *SliceHeader
func ReadSliceHeader ¶
func ReadSliceHeader(p unsafe.Pointer) *SliceHeader
Click to show internal directories.
Click to hide internal directories.