Skip to content

Commit

Permalink
Set reserved freespace entries to zero length until updated
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Apr 30, 2024
1 parent cc10931 commit d728d28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions dependencies/lmdb/libraries/liblmdb/mdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -4261,6 +4261,7 @@ mdb_freelist_save(MDB_txn *txn)
data.mv_size = (len + (head_id < pglast ? 2 : 1)) * sizeof(pgno_t);
//fprintf(stderr, "id: %u size: %u", head_id, data.mv_size);
rc = mdb_cursor_put(&mc, &key, &data, MDB_RESERVE);
*(pgno_t*)data.mv_data = 0; // set the size of the entry to zero in case it doesn't get overwritten
head_id++;
if (rc)
return rc;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lmdb",
"author": "Kris Zyp",
"version": "3.0.7",
"version": "3.0.8",
"description": "Simple, efficient, scalable, high-performance LMDB interface",
"license": "MIT",
"repository": {
Expand Down

0 comments on commit d728d28

Please sign in to comment.