3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-11 09:44:43 +00:00

Java bindings with no finalizers

Replacing finalizers with PhantomReferences, required quite a lot of
changes to the codebase.
This commit is contained in:
George Karpenkov 2016-06-12 14:18:13 +02:00
parent dfc80d3b69
commit 495ef0f055
48 changed files with 368 additions and 939 deletions

View file

@ -187,34 +187,15 @@ public class AST extends Z3Object implements Comparable<AST>
return Native.astToString(getContext().nCtx(), getNativeObject());
}
AST(Context ctx)
{
super(ctx);
}
AST(Context ctx, long obj)
{
AST(Context ctx, long obj) {
super(ctx, obj);
}
@Override
void incRef(long o)
{
// Console.WriteLine("AST IncRef()");
if (getContext() == null || o == 0)
return;
getContext().getASTDRQ().incAndClear(getContext(), o);
super.incRef(o);
}
@Override
void decRef(long o)
{
// Console.WriteLine("AST DecRef()");
if (getContext() == null || o == 0)
return;
getContext().getASTDRQ().add(o);
super.decRef(o);
Native.incRef(getContext().nCtx(), o);
getContext().getASTDRQ().storeReference(getContext(), this);
}
static AST create(Context ctx, long obj)