Version: v0.0.0-...-b87070f Latest Latest

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

Go to latest
Published: Aug 4, 2021 License: ISC Imports: 4 Imported by: 0



Package intern implements value interning for Cgo sharing.



This section is empty.


This section is empty.


func MakeStrong

func MakeStrong(gobject unsafe.Pointer)

MakeStrong forces the Box instance associated with the given object to be strongly referenced.

func MakeWeak

func MakeWeak(gobject unsafe.Pointer)

MakeWeak forces the Box intsance associated with the given object to be weakly referenced.

func ObjectClosure

func ObjectClosure(gobject, gclosure unsafe.Pointer) *closure.FuncStack

ObjectClosure gets the FuncStack instance from the given GObject and GClosure pointers. The given unsafe.Pointers MUST be C pointers.

func RemoveClosure

func RemoveClosure(gobject, gclosure unsafe.Pointer)

RemoveClosure removes the given GClosure callback.

func ShouldFree

func ShouldFree(gobject unsafe.Pointer) bool

ShouldFree must only be called during finalizing of an object. It's used to know if an object should be freed or not during finalization. If false is returned, then the object must not be freed yet.


type Box

type Box struct {
	Closures closure.Registry

Box contains possible interned values for each GObject.

func ObjectBox

func ObjectBox(gobject unsafe.Pointer) *Box

ObjectBox gets the interned box for the given GObject C pointer. If the object is new or unknown, then a new box is made.

Source Files

Jump to

Keyboard shortcuts

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