Class NativeAllocation
Utility class to manage
destructors for native allocations.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic final class -
Method Summary
Modifier and TypeMethodDescriptionstatic NativeAllocation.QueueReturns a global defaultNativeAllocation.Queue.Methods inherited from class java.lang.ref.PhantomReference
getMethods inherited from class java.lang.ref.Reference
clear, clone, enqueue, isEnqueued, reachabilityFence, refersTo
-
Method Details
-
getGlobalQueue
Returns a global defaultNativeAllocation.Queue. Most users of this class usually want to use this global queue.Note however that the
NativeAllocation.Destructorobject will be kept alive by theNativeAllocation.Queueuntil after thejavaObjectdies, so care must be taken with potential references from theNativeAllocation.Destructorback to thejavaObject. Such a reference cycle will keep thejavaObjectalive until theNativeAllocation.Queuedies. In that case, a localNativeAllocation.Queuemust be used to prevent memory leaks.
-