mdbx: allow 256-byte pages.

Change-Id: I697de67683fb040ea0e360515a5a0839d97e9aa6
This commit is contained in:
Leonid Yuriev 2019-10-05 22:46:12 +03:00
parent 8291de71cb
commit 440bfec193
2 changed files with 3 additions and 3 deletions

View File

@ -3275,7 +3275,7 @@ done:
__hot static void mdbx_page_copy(MDBX_page *dst, MDBX_page *src,
unsigned psize) {
STATIC_ASSERT(UINT16_MAX > MAX_PAGESIZE - PAGEHDRSZ);
STATIC_ASSERT(MIN_PAGESIZE > PAGEHDRSZ + NODESIZE * 42);
STATIC_ASSERT(MIN_PAGESIZE > PAGEHDRSZ + NODESIZE * 4);
if (!IS_LEAF2(src)) {
size_t upper = src->mp_upper, lower = src->mp_lower, unused = upper - lower;
@ -6298,7 +6298,7 @@ static void __cold mdbx_setup_pagesize(MDBX_env *env, const size_t pagesize) {
mdbx_ensure(env, pagesize <= MAX_PAGESIZE);
env->me_psize = (unsigned)pagesize;
STATIC_ASSERT(mdbx_maxgc_ov1page(MIN_PAGESIZE) > 42);
STATIC_ASSERT(mdbx_maxgc_ov1page(MIN_PAGESIZE) > 4);
STATIC_ASSERT(mdbx_maxgc_ov1page(MAX_PAGESIZE) < MDBX_DPL_TXNFULL);
const intptr_t maxgc_ov1page = (pagesize - PAGEHDRSZ) / sizeof(pgno_t) - 1;
mdbx_ensure(env,

View File

@ -612,7 +612,7 @@ typedef struct MDBX_lockinfo {
* pressure from other processes is high. So until OSs have
* actual paging support for Huge pages, they're not viable. */
#define MAX_PAGESIZE 0x10000u
#define MIN_PAGESIZE 512u
#define MIN_PAGESIZE 256u
#define MIN_MAPSIZE (MIN_PAGESIZE * MIN_PAGENO)
#if defined(_WIN32) || defined(_WIN64)