3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 19:05:51 +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

@ -222,11 +222,11 @@ public class Goal extends Z3Object
**/
public BoolExpr AsBoolExpr() {
int n = size();
if (n == 0)
if (n == 0) {
return getContext().mkTrue();
else if (n == 1)
} else if (n == 1) {
return getFormulas()[0];
else {
} else {
return getContext().mkAnd(getFormulas());
}
}
@ -236,23 +236,14 @@ public class Goal extends Z3Object
super(ctx, obj);
}
Goal(Context ctx, boolean models, boolean unsatCores, boolean proofs)
{
Goal(Context ctx, boolean models, boolean unsatCores, boolean proofs) {
super(ctx, Native.mkGoal(ctx.nCtx(), (models),
(unsatCores), (proofs)));
}
void incRef(long o)
{
getContext().getGoalDRQ().incAndClear(getContext(), o);
super.incRef(o);
@Override
void incRef(long o) {
Native.goalIncRef(getContext().nCtx(), o);
getContext().getGoalDRQ().storeReference(getContext(), this);
}
void decRef(long o)
{
getContext().getGoalDRQ().add(o);
super.decRef(o);
}
}