Documentation
¶
Overview ¶
Package keepalive provides a simple Acquire and Release mechanism to make sure data is kept alive in between.
This is used to access data that is not managed by Go, and hence the GC has no way of knowing if its in use.
Example: the code guarantees that `resource` is being kept alive, and `data` is valid until released, and hence `data` (presumably Go GC doesn't know about it) can be safely accessed.
ref := keeplive.Acquire(resource) defer ref.Release() data := resource.C_data ...
The package also provides ListAcquired method to investigate leaks (resources allocated but not released).
Index ¶
Constants ¶
View Source
const EndOfList = KeepAlive(-1)
View Source
const InitialFreeSlots = 128
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.