summaryrefslogtreecommitdiff
path: root/test/java/BitVectorsAndArrays.java
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2020-06-18 12:21:02 -0700
committerGitHub <noreply@github.com>2020-06-18 12:21:02 -0700
commit7d16d25dc9c527848eddac8414db22fe63b38e59 (patch)
treef56c6c16ad424bd6b90c629aa25584a72e6d5acf /test/java/BitVectorsAndArrays.java
parentc752258539ddb4c97b4fcbe7481cb1151ad182d0 (diff)
Improve memory management in Java bindings (#4629)
Fixes #2846. One of the challenges of the Java bindings is that the garbage collector can delete unused objects at any time in any order. This is an issue with CVC4's API because we require all `Expr`s to be deleted before the corresponding `ExprManager`. In the past, we were using `NewGlobalRef`/`DeleteGlobalRef` on the wrapper object of `ExprManager`. The problem is that we can have multiple instances of the wrapper that internally all refer to the same `ExprManager`. This commit implements a different approach where the Java wrappers hold an explicit reference to the `ExprManager`. The commit also removes some unused or unimportant API bits from the bindings.
Diffstat (limited to 'test/java/BitVectorsAndArrays.java')
-rw-r--r--test/java/BitVectorsAndArrays.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/java/BitVectorsAndArrays.java b/test/java/BitVectorsAndArrays.java
index dc78f89c2..c60c49696 100644
--- a/test/java/BitVectorsAndArrays.java
+++ b/test/java/BitVectorsAndArrays.java
@@ -76,7 +76,7 @@ public class BitVectorsAndArrays {
Expr old_current = em.mkExpr(Kind.SELECT, current_array, index);
Expr two = em.mkConst(new BitVector(32, 2));
- vectorExpr assertions = new vectorExpr();
+ vectorExpr assertions = new vectorExpr(em);
for (int i = 1; i < k; ++i) {
index = em.mkConst(
new BitVector(index_size, new edu.stanford.CVC4.Integer(i)));
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback