Package com.microsoft.z3
Class IDecRefQueue<T extends Z3Object>
- java.lang.Object
-
- com.microsoft.z3.IDecRefQueue<T>
-
- Type Parameters:
T- Type of object stored in queue.
- Direct Known Subclasses:
ConstructorDecRefQueue,ConstructorListDecRefQueue
public abstract class IDecRefQueue<T extends Z3Object> extends Object
A queue to handle management of native memory.Mechanics: once an object is created, a metadata is stored for it in
referenceMap, and aPhantomReferenceis created with a reference toreferenceQueue. Once the object becomes strongly unreachable, the phantom reference gets added by JVM to thereferenceQueue. After each object creation, we iterate through the available objects inreferenceQueueand decrement references for them.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedIDecRefQueue()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidclear(Context ctx)Clean all references currently inreferenceQueue.protected abstract voiddecRef(Context ctx, long obj)An implementation of this method should decrement the reference on a given native object.voidforceClear(Context ctx)Clean all references stored inreferenceMap, regardless of whether they are inreferenceMapor not.voidstoreReference(Context ctx, T obj)
-
-
-
Method Detail
-
decRef
protected abstract void decRef(Context ctx, long obj)
An implementation of this method should decrement the reference on a given native object. This function should always be called on thectxthread.- Parameters:
ctx- Z3 context.obj- Pointer to a Z3 object.
-
clear
protected void clear(Context ctx)
Clean all references currently inreferenceQueue.
-
forceClear
public void forceClear(Context ctx)
Clean all references stored inreferenceMap, regardless of whether they are inreferenceMapor not.
-
-