mdbx: косметический рефакторинг txn_renew().

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2025-07-15 14:53:05 +03:00
parent 0c70b548e8
commit e9d47291b0

View File

@ -214,7 +214,9 @@ int txn_renew(MDBX_txn *txn, unsigned flags) {
if (unlikely(env->flags & ENV_FATAL_ERROR)) {
WARNING("%s", "environment had fatal error, must shutdown!");
rc = MDBX_PANIC;
} else {
goto bailout;
}
const size_t size_bytes = pgno2bytes(env, txn->geo.end_pgno);
const size_t used_bytes = pgno2bytes(env, txn->geo.first_unallocated);
const size_t required_bytes = (txn->flags & MDBX_TXN_RDONLY) ? used_bytes : size_bytes;
@ -321,7 +323,7 @@ int txn_renew(MDBX_txn *txn, unsigned flags) {
}
dxb_sanitize_tail(env, txn);
return MDBX_SUCCESS;
}
bailout:
tASSERT(txn, rc != MDBX_SUCCESS);
txn_end(txn, TXN_END_SLOT | TXN_END_FAIL_BEGIN);