cgoconverter

package
v0.0.0-...-1593278 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract

func Extract(lease int32) unsafe.Pointer

func Release

func Release(lease int32)

func UnsafeGoBytes

func UnsafeGoBytes(cbytes *unsafe.Pointer, len int) (int32, []byte)

Types

type BytesConverter

type BytesConverter struct {
	// contains filtered or unexported fields
}

func NewBytesConverter

func NewBytesConverter() *BytesConverter

func (*BytesConverter) Extract

func (converter *BytesConverter) Extract(lease int32) unsafe.Pointer

func (*BytesConverter) Release

func (converter *BytesConverter) Release(lease int32)

func (*BytesConverter) ReleaseAll

func (converter *BytesConverter) ReleaseAll()

Make sure only the caller own the converter or this would release someone's memory

func (*BytesConverter) UnsafeGoBytes

func (converter *BytesConverter) UnsafeGoBytes(cbytes *unsafe.Pointer, len int) (int32, []byte)

Return a lease and []byte from C bytes (typically char*) which references the same memory of C bytes Call Release(lease) after you don't need the returned []byte

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL