
public final class JNINativeFinalizer extends Object
RefCounted classes and nulled when
that object is collected. It has no references to any (non static) members
and so its finalize() method will not hold up the collection of any
other object.
It exists so that we still have a mechanism that always frees native memory;
in most cases the JNIReference will enqueue correctly with the
JNIMemoryManager, and then the next call to a Ferry based method will
drain that queue, but sometimes there is no extra call to one of those
methods; in this case we'll drain the queue when this gets finalized.
It does a JNIMemoryManager.gc() which might race with the
JNIMemoryManager.gc() that a JNIReference does on allocation
of a new object but that's a safe race.
public JNINativeFinalizer()
JNINativeFinalizer. This object must
contain no references to any other objects in the system.Copyright © 2018 Humble Software. All rights reserved.