mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-15 22:54:31 +08:00
mdbx: вычленение txl_contain()
.
This commit is contained in:
parent
bc56a613ab
commit
b9e4c1ea73
@ -590,13 +590,7 @@ static inline bool is_gc_usable(MDBX_txn *txn, const MDBX_cursor *mc, const uint
|
||||
return true;
|
||||
}
|
||||
|
||||
__hot static bool is_already_reclaimed(const MDBX_txn *txn, txnid_t id) {
|
||||
const size_t len = MDBX_PNL_GETSIZE(txn->tw.gc.retxl);
|
||||
for (size_t i = 1; i <= len; ++i)
|
||||
if (txn->tw.gc.retxl[i] == id)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
static inline bool is_already_reclaimed(const MDBX_txn *txn, txnid_t id) { return txl_contain(txn->tw.gc.retxl, id); }
|
||||
|
||||
__hot static pgno_t repnl_get_single(MDBX_txn *txn) {
|
||||
const size_t len = MDBX_PNL_GETSIZE(txn->tw.repnl);
|
||||
|
@ -89,3 +89,11 @@ int __must_check_result txl_append(txl_t __restrict *ptxl, txnid_t id) {
|
||||
txl_xappend(*ptxl, id);
|
||||
return MDBX_SUCCESS;
|
||||
}
|
||||
|
||||
__hot bool txl_contain(const txl_t txl, txnid_t id) {
|
||||
const size_t len = MDBX_PNL_GETSIZE(txl);
|
||||
for (size_t i = 1; i <= len; ++i)
|
||||
if (txl[i] == id)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user