From 204b5a532d2e84ee4b9fb4919851667efffebd0c Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Fri, 31 Aug 2018 03:03:53 +0300 Subject: [PATCH] mdbx: backport - shorten maxkeysize (will be fixed in the master branch). Change-Id: I660b1b3e454d9b51a24d3b4cc987c8e2980bd435 --- src/mdbx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mdbx.c b/src/mdbx.c index a6c23c4c..e279b447 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -4902,7 +4902,7 @@ int __cold mdbx_env_get_maxkeysize(MDBX_env *env) { #define mdbx_nodemax(pagesize) \ (((((pagesize)-PAGEHDRSZ) / MDBX_MINKEYS) & -(intptr_t)2) - sizeof(indx_t)) -#define mdbx_maxkey(nodemax) ((nodemax) - (NODESIZE + sizeof(MDBX_db))) +#define mdbx_maxkey(nodemax) (((nodemax)-NODESIZE - sizeof(MDBX_db)) / 2) #define mdbx_maxgc_ov1page(pagesize) \ (((pagesize)-PAGEHDRSZ) / sizeof(pgno_t) - 1)