mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-08 04:44:14 +08:00
mdbx: minor format spaces/tabs.
Change-Id: Ic9cce2e7a2552fb062ab8709121c72a9131be8b6
This commit is contained in:
parent
e7859934f2
commit
b59f25fd46
15
mdb.c
15
mdb.c
@ -4898,8 +4898,8 @@ mdbx_env_open_ex(MDB_env *env, const char *path, unsigned flags, mode_t mode, in
|
|||||||
flags &= ~(MDB_WRITEMAP | MDB_MAPASYNC | MDB_NOSYNC | MDB_NOMETASYNC
|
flags &= ~(MDB_WRITEMAP | MDB_MAPASYNC | MDB_NOSYNC | MDB_NOMETASYNC
|
||||||
| MDB_COALESCE | MDB_LIFORECLAIM | MDB_NOMEMINIT);
|
| MDB_COALESCE | MDB_LIFORECLAIM | MDB_NOMEMINIT);
|
||||||
} else {
|
} else {
|
||||||
if (!((env->me_free_pgs = mdb_midl_alloc(MDB_IDL_UM_MAX)) &&
|
if (!((env->me_free_pgs = mdb_midl_alloc(MDB_IDL_UM_MAX))
|
||||||
(env->me_dirty_list = calloc(MDB_IDL_UM_SIZE, sizeof(MDB_ID2)))))
|
&& (env->me_dirty_list = calloc(MDB_IDL_UM_SIZE, sizeof(MDB_ID2)))))
|
||||||
rc = ENOMEM;
|
rc = ENOMEM;
|
||||||
}
|
}
|
||||||
env->me_flags = flags |= MDB_ENV_ACTIVE;
|
env->me_flags = flags |= MDB_ENV_ACTIVE;
|
||||||
@ -5791,7 +5791,8 @@ mdb_cursor_sibling(MDB_cursor *mc, int move_right)
|
|||||||
mdb_debug("parent page is page %zu, index %u",
|
mdb_debug("parent page is page %zu, index %u",
|
||||||
mc->mc_pg[mc->mc_top]->mp_pgno, mc->mc_ki[mc->mc_top]);
|
mc->mc_pg[mc->mc_top]->mp_pgno, mc->mc_ki[mc->mc_top]);
|
||||||
|
|
||||||
if (move_right ? (mc->mc_ki[mc->mc_top] + 1u >= NUMKEYS(mc->mc_pg[mc->mc_top]))
|
if (move_right
|
||||||
|
? (mc->mc_ki[mc->mc_top] + 1u >= NUMKEYS(mc->mc_pg[mc->mc_top]))
|
||||||
: (mc->mc_ki[mc->mc_top] == 0)) {
|
: (mc->mc_ki[mc->mc_top] == 0)) {
|
||||||
mdb_debug("no more keys left, moving to %s sibling",
|
mdb_debug("no more keys left, moving to %s sibling",
|
||||||
move_right ? "right" : "left");
|
move_right ? "right" : "left");
|
||||||
@ -6642,8 +6643,7 @@ mdb_cursor_put(MDB_cursor *mc, MDB_val *key, MDB_val *data,
|
|||||||
mc->mc_db->md_root = np->mp_pgno;
|
mc->mc_db->md_root = np->mp_pgno;
|
||||||
mc->mc_db->md_depth++;
|
mc->mc_db->md_depth++;
|
||||||
*mc->mc_dbflag |= DB_DIRTY;
|
*mc->mc_dbflag |= DB_DIRTY;
|
||||||
if ((mc->mc_db->md_flags & (MDB_DUPSORT|MDB_DUPFIXED))
|
if ((mc->mc_db->md_flags & (MDB_DUPSORT|MDB_DUPFIXED)) == MDB_DUPFIXED)
|
||||||
== MDB_DUPFIXED)
|
|
||||||
np->mp_flags |= P_LEAF2;
|
np->mp_flags |= P_LEAF2;
|
||||||
mc->mc_flags |= C_INITIALIZED;
|
mc->mc_flags |= C_INITIALIZED;
|
||||||
} else {
|
} else {
|
||||||
@ -6848,9 +6848,8 @@ current:
|
|||||||
|
|
||||||
/* Is the ov page large enough? */
|
/* Is the ov page large enough? */
|
||||||
if (ovpages >= dpages) {
|
if (ovpages >= dpages) {
|
||||||
if (!(omp->mp_flags & P_DIRTY) &&
|
if (!(omp->mp_flags & P_DIRTY)
|
||||||
(level || (env->me_flags & MDB_WRITEMAP)))
|
&& (level || (env->me_flags & MDB_WRITEMAP))) {
|
||||||
{
|
|
||||||
rc = mdb_page_unspill(mc->mc_txn, omp, &omp);
|
rc = mdb_page_unspill(mc->mc_txn, omp, &omp);
|
||||||
if (unlikely(rc))
|
if (unlikely(rc))
|
||||||
return rc;
|
return rc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user