Skip to content

Commit

Permalink
changes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
hmottestad committed Jun 5, 2024
1 parent e66a4e1 commit 860ffb1
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ private void open() throws IOException {
mdb_stat(txn, unusedDbi, stat);
if (stat.ms_entries() > 0) {
// free unused IDs
resizeMap(txn, stat.ms_entries() * (2 + Long.BYTES));
resizeMap(txn, stat.ms_entries() * (2L + Long.BYTES));

writeTransaction((stack2, txn2) -> {
freeUnusedIdsAndValues(stack2, txn2, null);
Expand Down Expand Up @@ -671,7 +671,7 @@ private long findId(byte[] data, boolean create) throws IOException {
return null;
}
// id was not found, create a new one
resizeMap(txn, 2L * data.length + 4L);
resizeMap(txn, 2L * data.length + 2L * (2L + Long.BYTES));

long newId = nextId(data[0]);
writeTransaction((stack2, writeTxn) -> {
Expand Down Expand Up @@ -714,7 +714,7 @@ private long findId(byte[] data, boolean create) throws IOException {
return null;
}

resizeMap(txn, 2L * data.length + 2L * 2L);
resizeMap(txn, 2L * data.length + 2L * (2L + Long.BYTES));

long newId = nextId(data[0]);
writeTransaction((stack2, writeTxn) -> {
Expand Down Expand Up @@ -773,7 +773,7 @@ private long findId(byte[] data, boolean create) throws IOException {
}

// id was not found, create a new one
resizeMap(txn, 1 + Long.BYTES + maxHashKeyLength + 2 * data.length);
resizeMap(txn, 1 + Long.BYTES + maxHashKeyLength + 2L * data.length);

long newId = nextId(data[0]);
writeTransaction((stack2, writeTxn) -> {
Expand Down Expand Up @@ -1155,7 +1155,7 @@ public void startTransaction(boolean resize) throws IOException {
mdb_stat(writeTxn, unusedDbi, stat);

if (resize) {
resizeMap(writeTxn, stat.ms_entries() * (2 + Long.BYTES));
resizeMap(writeTxn, stat.ms_entries() * (2L + Long.BYTES));
}

freeUnusedIdsAndValues(stack, writeTxn, unusedRevisionIds);
Expand Down

0 comments on commit 860ffb1

Please sign in to comment.