Documentation
¶
Overview ¶
Package handle wrap/unwrap Go pointers for C.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dump ¶
func Dump() string
Dump returns a string representation of all existing handles and pinned slices.
func PinSliceData ¶
PinSliceData pins the content of a slice so that it can shared with C. Call unpinSliceData to release the reference to the slice data.
func Release ¶
func Release(h Handle)
Release deletes a cgx handle.
The handle must not be used (either through Unwrap or Release) after deletion.
func UnpinSliceData ¶
UnpinSliceData unpin the data of a slice.
Types ¶
type Handle ¶
type Handle uintptr
Handle to a Go object.
func Wrap ¶
func Wrap[T comparable](v T) Handle
Wrap converts a Go value to a cgx_handle.
Handles must be unwrapped with the Unwrap() function using the same type T.
func WrapSlice ¶
func WrapSlice[T comparable](vs []T) []Handle
WrapSlice wraps all the element of a slice.
Click to show internal directories.
Click to hide internal directories.