mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 17:34:14 +08:00
mdbx: merge branch 'devel'.
Change-Id: I2593f0229694d0bdd310975887e31651ead6dcc0
This commit is contained in:
commit
8cabd99d24
13
src/core.c
13
src/core.c
@ -3293,8 +3293,10 @@ static MDBX_dpl *mdbx_dpl_reserve(MDBX_txn *txn, size_t size) {
|
|||||||
static int mdbx_dpl_alloc(MDBX_txn *txn) {
|
static int mdbx_dpl_alloc(MDBX_txn *txn) {
|
||||||
mdbx_tassert(txn,
|
mdbx_tassert(txn,
|
||||||
(txn->mt_flags & MDBX_TXN_RDONLY) == 0 && !txn->tw.dirtylist);
|
(txn->mt_flags & MDBX_TXN_RDONLY) == 0 && !txn->tw.dirtylist);
|
||||||
MDBX_dpl *const dl =
|
const size_t len = (txn->mt_env->me_options.dp_initial < txn->mt_geo.upper)
|
||||||
mdbx_dpl_reserve(txn, txn->mt_env->me_options.dp_initial);
|
? txn->mt_env->me_options.dp_initial
|
||||||
|
: txn->mt_geo.upper;
|
||||||
|
MDBX_dpl *const dl = mdbx_dpl_reserve(txn, len);
|
||||||
if (unlikely(!dl))
|
if (unlikely(!dl))
|
||||||
return MDBX_ENOMEM;
|
return MDBX_ENOMEM;
|
||||||
mdbx_dpl_clear(dl);
|
mdbx_dpl_clear(dl);
|
||||||
@ -14608,8 +14610,8 @@ int mdbx_cursor_del(MDBX_cursor *mc, MDBX_put_flags_t flags) {
|
|||||||
if (unlikely(mc->mc_ki[mc->mc_top] >= page_numkeys(mc->mc_pg[mc->mc_top])))
|
if (unlikely(mc->mc_ki[mc->mc_top] >= page_numkeys(mc->mc_pg[mc->mc_top])))
|
||||||
return MDBX_NOTFOUND;
|
return MDBX_NOTFOUND;
|
||||||
|
|
||||||
if (unlikely(!(flags & MDBX_NOSPILL) &&
|
if (likely((flags & MDBX_NOSPILL) == 0) &&
|
||||||
(rc = mdbx_cursor_spill(mc, NULL, NULL))))
|
unlikely(rc = mdbx_cursor_spill(mc, NULL, NULL)))
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rc = mdbx_cursor_touch(mc);
|
rc = mdbx_cursor_touch(mc);
|
||||||
@ -20902,8 +20904,7 @@ __cold int mdbx_env_set_option(MDBX_env *env, const MDBX_option_t option,
|
|||||||
|
|
||||||
case MDBX_opt_txn_dp_limit:
|
case MDBX_opt_txn_dp_limit:
|
||||||
case MDBX_opt_txn_dp_initial:
|
case MDBX_opt_txn_dp_initial:
|
||||||
if (unlikely(value > MDBX_PGL_LIMIT || value < CURSOR_STACK * 4 ||
|
if (unlikely(value > MDBX_PGL_LIMIT || value < CURSOR_STACK * 4))
|
||||||
value > bytes2pgno(env, env->me_dbgeo.upper) - NUM_METAS))
|
|
||||||
return MDBX_EINVAL;
|
return MDBX_EINVAL;
|
||||||
if (unlikely(env->me_txn0 == NULL))
|
if (unlikely(env->me_txn0 == NULL))
|
||||||
return MDBX_EACCESS;
|
return MDBX_EACCESS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user