mdbx: minor refine mdbx_txn_merge().

This commit is contained in:
Leonid Yuriev 2021-01-21 22:45:34 +03:00
parent 0861a0652b
commit e0d4eaf819

View File

@ -8554,9 +8554,10 @@ static __inline void mdbx_txn_merge(MDBX_txn *const parent, MDBX_txn *const txn,
MDBX_dpl *const dst = mdbx_dpl_sort(parent->tw.dirtylist); MDBX_dpl *const dst = mdbx_dpl_sort(parent->tw.dirtylist);
while (MDBX_ENABLE_REFUND && dst->length && while (MDBX_ENABLE_REFUND && dst->length &&
dst->items[dst->length].pgno >= parent->mt_next_pgno) { dst->items[dst->length].pgno >= parent->mt_next_pgno) {
MDBX_page *mp = dst->items[dst->length].ptr; if (!(txn->mt_env->me_flags & MDBX_WRITEMAP)) {
if (mp && (txn->mt_env->me_flags & MDBX_WRITEMAP) == 0) MDBX_page *dp = dst->items[dst->length].ptr;
mdbx_dpage_free(txn->mt_env, mp, IS_OVERFLOW(mp) ? mp->mp_pages : 1); mdbx_dpage_free(txn->mt_env, dp, IS_OVERFLOW(dp) ? dp->mp_pages : 1);
}
dst->length -= 1; dst->length -= 1;
} }
parent->tw.dirtyroom += dst->sorted - dst->length; parent->tw.dirtyroom += dst->sorted - dst->length;