Skip to content

Commit

Permalink
Move the free call to spilled pages before the mutex is unlocked, #48
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed May 26, 2021
1 parent 9134b31 commit c346d2c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions dependencies/lmdb/libraries/liblmdb/mdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3587,6 +3587,10 @@ mdb_txn_end(MDB_txn *txn, unsigned mode)
txn->mt_numdbs = 0;
txn->mt_flags = MDB_TXN_FINISHED;

mdb_midl_free(txn->mt_spill_pgs);
#if OVERFLOW_NOTYET
mdb_mid2l_free(txn->mt_dirty_ovs);
#endif
if (!txn->mt_parent) {
mdb_midl_shrink(&txn->mt_free_pgs);
env->me_free_pgs = txn->mt_free_pgs;
Expand All @@ -3607,11 +3611,6 @@ mdb_txn_end(MDB_txn *txn, unsigned mode)
mdb_midl_free(txn->mt_free_pgs);
free(txn->mt_u.dirty_list);
}
mdb_midl_free(txn->mt_spill_pgs);
#if OVERFLOW_NOTYET
mdb_mid2l_free(txn->mt_dirty_ovs);
#endif

mdb_midl_free(pghead);
}
#if MDB_RPAGE_CACHE
Expand Down

0 comments on commit c346d2c

Please sign in to comment.