From f4ca6ed6b9977296db71a8f990ebb702c714b538 Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Mon, 2 Oct 2017 18:01:08 +0300 Subject: [PATCH] mdbx: fix handling MAX_MAPSIZE32 limit. --- src/mdbx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mdbx.c b/src/mdbx.c index 897051a1..bb2bb1f9 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -4473,7 +4473,8 @@ LIBMDBX_API int mdbx_env_set_geometry(MDBX_env *env, intptr_t size_lower, if ((size_t)size_now >= MAX_MAPSIZE / 2) size_upper = MAX_MAPSIZE; else if (MAX_MAPSIZE != MAX_MAPSIZE32 && - (size_t)size_now >= MAX_MAPSIZE32 / 2) + (size_t)size_now >= MAX_MAPSIZE32 / 2 && + (size_t)size_now <= MAX_MAPSIZE32 / 4 * 3) size_upper = MAX_MAPSIZE32; else { size_upper = size_now + size_now;