mdbx: refine db growth step default.

Change-Id: Ief80441cb578ae37d5d7cee4766e57eaacb4bbde
This commit is contained in:
Leonid Yuriev 2021-03-09 12:55:42 +03:00
parent 8e51a10908
commit cd90f831af

View File

@ -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;