From cd90f831af66a285e364e5790aab6a3dac4129f8 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Tue, 9 Mar 2021 12:55:42 +0300 Subject: [PATCH] mdbx: refine db growth step default. Change-Id: Ief80441cb578ae37d5d7cee4766e57eaacb4bbde --- src/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core.c b/src/core.c index 3cb5cfb1..701f9733 100644 --- a/src/core.c +++ b/src/core.c @@ -10663,12 +10663,12 @@ mdbx_env_set_geometry(MDBX_env *env, intptr_t size_lower, intptr_t size_now, if (growth_step < 0) { growth_step = ((size_t)(size_upper - size_lower)) / 42; - if (growth_step > size_lower) + if (growth_step > size_lower && size_lower < (intptr_t)MEGABYTE) growth_step = size_lower; if (growth_step < 65536) growth_step = 65536; - if ((size_t)growth_step > MEGABYTE * 16) - growth_step = MEGABYTE * 16; + if ((size_t)growth_step > MAX_MAPSIZE / 64) + growth_step = MAX_MAPSIZE / 64; } if (growth_step == 0 && shrink_threshold > 0) growth_step = 1;