mdbx: minore refine mdbx_page_alloc().

Change-Id: Ie5e5db2a0d24547544c55467cafa6237aead8c84
This commit is contained in:
Leonid Yuriev 2018-09-04 12:29:41 +03:00 committed by Leo Yuriev
parent 22e7630d53
commit 69c14f3694

View File

@ -2451,13 +2451,11 @@ static int mdbx_page_alloc(MDBX_cursor *mc, unsigned num, MDBX_page **mp,
}
/* Don't try to coalesce too much. */
if (unlikely(repg_len > MDBX_DPL_TXNFULL / 2))
if (unlikely(repg_len > MDBX_DPL_TXNFULL / 4))
break;
if (flags & MDBX_COALESCE) {
if (repg_len /* current size */ >= env->me_maxgc_ov1page ||
repg_pos /* prev size */ >= env->me_maxgc_ov1page / 2)
flags &= ~MDBX_COALESCE;
}
if (repg_len /* current size */ >= env->me_maxgc_ov1page ||
repg_pos /* prev size */ >= env->me_maxgc_ov1page / 2)
flags &= ~MDBX_COALESCE;
}
if ((flags & (MDBX_COALESCE | MDBX_ALLOC_CACHE)) ==