mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-06 22:34:12 +08:00
mdbx: minore refine mdbx_page_alloc().
Change-Id: Ie5e5db2a0d24547544c55467cafa6237aead8c84
This commit is contained in:
parent
22e7630d53
commit
69c14f3694
10
src/mdbx.c
10
src/mdbx.c
@ -2451,13 +2451,11 @@ static int mdbx_page_alloc(MDBX_cursor *mc, unsigned num, MDBX_page **mp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Don't try to coalesce too much. */
|
/* Don't try to coalesce too much. */
|
||||||
if (unlikely(repg_len > MDBX_DPL_TXNFULL / 2))
|
if (unlikely(repg_len > MDBX_DPL_TXNFULL / 4))
|
||||||
break;
|
break;
|
||||||
if (flags & MDBX_COALESCE) {
|
if (repg_len /* current size */ >= env->me_maxgc_ov1page ||
|
||||||
if (repg_len /* current size */ >= env->me_maxgc_ov1page ||
|
repg_pos /* prev size */ >= env->me_maxgc_ov1page / 2)
|
||||||
repg_pos /* prev size */ >= env->me_maxgc_ov1page / 2)
|
flags &= ~MDBX_COALESCE;
|
||||||
flags &= ~MDBX_COALESCE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flags & (MDBX_COALESCE | MDBX_ALLOC_CACHE)) ==
|
if ((flags & (MDBX_COALESCE | MDBX_ALLOC_CACHE)) ==
|
||||||
|
Loading…
x
Reference in New Issue
Block a user