MCPcopy
hub / github.com/tinygo-org/tinygo / refMap

Struct refMap

cgo/sync.go:14–17  ·  view source on GitHub ↗

refMap is a convenient way to store opaque references that can be passed to C. It is useful if an API uses function pointers and you cannot pass a Go pointer but only a C pointer.

Source from the content-addressed store, hash-verified

12// C. It is useful if an API uses function pointers and you cannot pass a Go
13// pointer but only a C pointer.
14type refMap struct {
15 refs map[unsafe.Pointer]interface{}
16 lock sync.Mutex
17}
18
19// Put stores a value in the map. It can later be retrieved using Get. It must
20// be removed using Remove to avoid memory leaks.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected