mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-23 01:28:20 +08:00
mdbx: fix accounting mdbx_page_loose().
This commit is contained in:
parent
c3a9ad52ed
commit
6ce08100fa
14
src/mdbx.c
14
src/mdbx.c
@ -1523,7 +1523,16 @@ static int mdbx_page_loose(MDBX_cursor *mc, MDBX_page *mp) {
|
|||||||
const pgno_t pgno = mp->mp_pgno;
|
const pgno_t pgno = mp->mp_pgno;
|
||||||
MDBX_txn *txn = mc->mc_txn;
|
MDBX_txn *txn = mc->mc_txn;
|
||||||
|
|
||||||
mdbx_cassert(mc, (mc->mc_flags & C_SUB) == 0);
|
if (unlikely(mc->mc_flags & C_SUB)) {
|
||||||
|
MDBX_db *outer = mdbx_outer_db(mc);
|
||||||
|
if (IS_BRANCH(mp))
|
||||||
|
outer->md_branch_pages--;
|
||||||
|
else {
|
||||||
|
mdbx_cassert(mc, IS_LEAF(mp));
|
||||||
|
outer->md_leaf_pages--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (IS_BRANCH(mp))
|
if (IS_BRANCH(mp))
|
||||||
mc->mc_db->md_branch_pages--;
|
mc->mc_db->md_branch_pages--;
|
||||||
else {
|
else {
|
||||||
@ -1572,7 +1581,8 @@ static int mdbx_page_loose(MDBX_cursor *mc, MDBX_page *mp) {
|
|||||||
mp->mp_flags |= P_LOOSE;
|
mp->mp_flags |= P_LOOSE;
|
||||||
} else {
|
} else {
|
||||||
int rc = mdbx_pnl_append(&txn->mt_befree_pages, pgno);
|
int rc = mdbx_pnl_append(&txn->mt_befree_pages, pgno);
|
||||||
if (unlikely(rc))
|
mdbx_tassert(txn, rc == MDBX_SUCCESS);
|
||||||
|
if (unlikely(rc != MDBX_SUCCESS))
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user