mirror of
https://github.com/Z3Prover/z3
synced 2026-01-24 19:14:00 +00:00
Java API: split incRef into incRef and addToReferenceQueue
One method should do one thing only, it's easy to mix things up otherwise.
This commit is contained in:
parent
2a347f04bf
commit
22ffd65d1e
20 changed files with 150 additions and 87 deletions
|
|
@ -30,15 +30,20 @@ public abstract class Z3Object {
|
|||
m_ctx = ctx;
|
||||
checkNativeObject(obj);
|
||||
m_n_obj = obj;
|
||||
incRef(obj);
|
||||
incRef();
|
||||
addToReferenceQueue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Increment reference count on {@code o}.
|
||||
*
|
||||
* @param o Z3 object.
|
||||
* Add to ReferenceQueue for tracking reachability on the object and
|
||||
* decreasing the reference count when the object is no longer reachable.
|
||||
*/
|
||||
abstract void incRef(long o);
|
||||
abstract void addToReferenceQueue();
|
||||
|
||||
/**
|
||||
* Increment reference count on {@code this}.
|
||||
*/
|
||||
abstract void incRef();
|
||||
|
||||
/**
|
||||
* This function is provided for overriding, and a child class
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue