T - Type of object stored in queue.public abstract class IDecRefQueue<T extends Z3Object> extends Object
Mechanics: once an object is created, a metadata is stored for it in
referenceMap, and a PhantomReference is created with a
reference to referenceQueue.
Once the object becomes strongly unreachable, the phantom reference gets
added by JVM to the referenceQueue.
After each object creation, we iterate through the available objects in
referenceQueue and decrement references for them.
| Modifier | Constructor and Description |
|---|---|
protected |
IDecRefQueue() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
clear(Context ctx)
Clean all references currently in
referenceQueue. |
protected abstract void |
decRef(Context ctx,
long obj)
An implementation of this method should decrement the reference on a
given native object.
|
void |
forceClear(Context ctx)
Clean all references stored in
referenceMap,
regardless of whether they are in referenceMap or not. |
void |
storeReference(Context ctx,
T obj) |
protected abstract void decRef(Context ctx, long obj)
ctx thread.ctx - Z3 context.obj - Pointer to a Z3 object.protected void clear(Context ctx)
referenceQueue.public void forceClear(Context ctx)
referenceMap,
regardless of whether they are in referenceMap or not.