public final class NativeAllocation extends PhantomReference<Object>
destructors for native allocations.| Modifier and Type | Class and Description |
|---|---|
static class |
NativeAllocation.Destructor |
static class |
NativeAllocation.FreeDestructor |
static class |
NativeAllocation.Queue |
| Modifier and Type | Method and Description |
|---|---|
static NativeAllocation.Queue |
getGlobalQueue()
Returns a global default
NativeAllocation.Queue. |
getclear, enqueue, isEnqueuedpublic static NativeAllocation.Queue getGlobalQueue()
NativeAllocation.Queue. Most users of this class usually want to use this
global queue.
Note however that the NativeAllocation.Destructor object will be kept alive by the NativeAllocation.Queue until
after the javaObject dies, so care must be taken with potential references from the
NativeAllocation.Destructor back to the javaObject. Such a reference cycle will keep the
javaObject alive until the NativeAllocation.Queue dies. In that case, a local NativeAllocation.Queue
must be used to prevent memory leaks.