mirror of
https://github.com/isar/libmdbx.git
synced 2025-06-06 05:22:36 +08:00
mdbx: упрощение очистки MDBX_TXN_HAS_CHILD
.
This commit is contained in:
parent
b5503b5670
commit
270cf399aa
@ -326,7 +326,6 @@ static void txn_merge(MDBX_txn *const parent, MDBX_txn *const txn, const size_t
|
|||||||
tASSERT(parent, dpl_check(parent));
|
tASSERT(parent, dpl_check(parent));
|
||||||
}
|
}
|
||||||
|
|
||||||
parent->flags &= ~MDBX_TXN_HAS_CHILD;
|
|
||||||
if (parent->wr.spilled.list) {
|
if (parent->wr.spilled.list) {
|
||||||
assert(pnl_check_allocated(parent->wr.spilled.list, (size_t)parent->geo.first_unallocated << 1));
|
assert(pnl_check_allocated(parent->wr.spilled.list, (size_t)parent->geo.first_unallocated << 1));
|
||||||
if (MDBX_PNL_GETSIZE(parent->wr.spilled.list))
|
if (MDBX_PNL_GETSIZE(parent->wr.spilled.list))
|
||||||
@ -459,9 +458,6 @@ void txn_nested_abort(MDBX_txn *nested) {
|
|||||||
parent->wr.retired_pages = nested->wr.retired_pages;
|
parent->wr.retired_pages = nested->wr.retired_pages;
|
||||||
}
|
}
|
||||||
|
|
||||||
parent->wr.dirtylru = nested->wr.dirtylru;
|
|
||||||
parent->nested = nullptr;
|
|
||||||
parent->flags &= ~MDBX_TXN_HAS_CHILD;
|
|
||||||
tASSERT(parent, dpl_check(parent));
|
tASSERT(parent, dpl_check(parent));
|
||||||
tASSERT(parent, audit_ex(parent, 0, false) == 0);
|
tASSERT(parent, audit_ex(parent, 0, false) == 0);
|
||||||
dpl_release_shadows(nested);
|
dpl_release_shadows(nested);
|
||||||
@ -581,9 +577,10 @@ int txn_nested_join(MDBX_txn *txn, struct commit_timestamp *ts) {
|
|||||||
ts->sync = /* no sync */ ts->write;
|
ts->sync = /* no sync */ ts->write;
|
||||||
}
|
}
|
||||||
txn_merge(parent, txn, parent_retired_len);
|
txn_merge(parent, txn, parent_retired_len);
|
||||||
|
tASSERT(parent, parent->flags & MDBX_TXN_HAS_CHILD);
|
||||||
|
parent->flags -= MDBX_TXN_HAS_CHILD;
|
||||||
env->txn = parent;
|
env->txn = parent;
|
||||||
parent->nested = nullptr;
|
parent->nested = nullptr;
|
||||||
parent->flags &= ~MDBX_TXN_HAS_CHILD;
|
|
||||||
tASSERT(parent, dpl_check(parent));
|
tASSERT(parent, dpl_check(parent));
|
||||||
|
|
||||||
#if MDBX_ENABLE_REFUND
|
#if MDBX_ENABLE_REFUND
|
||||||
|
@ -352,7 +352,10 @@ int txn_end(MDBX_txn *txn, unsigned mode) {
|
|||||||
tASSERT(txn, pnl_check_allocated(txn->wr.repnl, txn->geo.first_unallocated - MDBX_ENABLE_REFUND));
|
tASSERT(txn, pnl_check_allocated(txn->wr.repnl, txn->geo.first_unallocated - MDBX_ENABLE_REFUND));
|
||||||
tASSERT(txn, memcmp(&txn->wr.troika, &parent->wr.troika, sizeof(troika_t)) == 0);
|
tASSERT(txn, memcmp(&txn->wr.troika, &parent->wr.troika, sizeof(troika_t)) == 0);
|
||||||
tASSERT(txn, mode & TXN_END_FREE);
|
tASSERT(txn, mode & TXN_END_FREE);
|
||||||
|
tASSERT(parent, parent->flags & MDBX_TXN_HAS_CHILD);
|
||||||
env->txn = parent;
|
env->txn = parent;
|
||||||
|
parent->nested = nullptr;
|
||||||
|
parent->flags -= MDBX_TXN_HAS_CHILD;
|
||||||
const pgno_t nested_now = txn->geo.now, nested_upper = txn->geo.upper;
|
const pgno_t nested_now = txn->geo.now, nested_upper = txn->geo.upper;
|
||||||
txn_nested_abort(txn);
|
txn_nested_abort(txn);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user