◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@
<version>0.9.29-1</version>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
Expand All @@ -110,6 +116,8 @@
</usedDependencies>
<ignoredDependencies>
<ignoredDependency>com.github.jnr:jffi</ignoredDependency>
</ignoredDependencies>
</configuration>
</plugin>
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/org/lmdbjava/Cursor.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ public boolean get(final T key, final T data, final SeekOp op) {
checkRc(rc);
kv.keyOut();
kv.valOut();
return true;
}

Expand Up @@ -192,6 +193,7 @@ public boolean get(final T key, final GetOp op) {
checkRc(rc);
kv.keyOut();
kv.valOut();
return true;
}

Expand Down Expand Up @@ -266,6 +268,8 @@ public boolean put(final T key, final T val, final PutFlags... op) {
return false;
}
checkRc(rc);
return true;
}

Expand Down Expand Up @@ -304,6 +308,8 @@ public void putMultiple(final T key, final T val, final int elements,
final int rc = LIB.mdb_cursor_put(ptrCursor, txn.kv().pointerKey(),
dataPtr, mask);
checkRc(rc);
}

/**
Expand Up @@ -362,6 +368,7 @@ public T reserve(final T key, final int size, final PutFlags... op) {
checkRc(LIB.mdb_cursor_put(ptrCursor, kv.pointerKey(), kv.pointerVal(),
flags));
kv.valOut();
return val();
}

Expand Down
6 changes: 6 additions & 0 deletions src/main/java/org/lmdbjava/Dbi.java
Original file line number Diff line number Diff line change
@@ -171,6 +171,8 @@ public boolean delete(final Txn<T> txn, final T key, final T val) {
return false;
}
checkRc(rc);
return true;
}

Expand Down Expand Up @@ -239,6 +241,7 @@ public T get(final Txn<T> txn, final T key) {
return null;
}
checkRc(rc);
return txn.kv().valOut(); // marked as out in LMDB C docs
}

Expand Up @@ -386,6 +389,8 @@ public boolean put(final Txn<T> txn, final T key, final T val,
return false;
}
checkRc(rc);
return true;
}

Expand Down Expand Up @@ -421,6 +426,7 @@ public T reserve(final Txn<T> txn, final T key, final int size,
checkRc(LIB.mdb_put(txn.pointer(), ptr, txn.kv().pointerKey(), txn.kv()
.pointerVal(), flags));
txn.kv().valOut(); // marked as in,out in LMDB C docs
return txn.val();
}

Expand Down
55 changes: 55 additions & 0 deletions src/main/java/org/lmdbjava/ReferenceUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
111 changes: 111 additions & 0 deletions src/test/java/org/lmdbjava/GarbageCollectionTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
Toggle all file notes Toggle all file annotations