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
A queue to handle management of native memory.
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidClean all references currently inreferenceQueue.protected abstract voidAn 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)
-
Constructor Details
-
IDecRefQueue
protected IDecRefQueue()
-
-
Method Details
-
decRef
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.
-
storeReference
-
clear
Clean all references currently inreferenceQueue. -
forceClear
Clean all references stored inreferenceMap, regardless of whether they are inreferenceMapor not.
-