From fa0a38c1ac9253f2b1df72d6ffd34b3559be8f22 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Tue, 5 Oct 2021 12:55:23 +0300 Subject: [PATCH] mdbx: avoid single-page (too small) shrink threshold by default when `MDBX_DEBUG > 0`. --- src/core.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core.c b/src/core.c index 5c0ebb74..88cf256b 100644 --- a/src/core.c +++ b/src/core.c @@ -11058,11 +11058,12 @@ mdbx_env_set_geometry(MDBX_env *env, intptr_t size_lower, intptr_t size_now, (env->me_txn0 && env->me_txn0->mt_owner == mdbx_thread_self()); #if MDBX_DEBUG - if (growth_step < 0) + if (growth_step < 0) { growth_step = 1; - if (shrink_threshold < 0) - shrink_threshold = 1; -#endif + if (shrink_threshold < 0) + shrink_threshold = 1; + } +#endif /* MDBX_DEBUG */ intptr_t reasonable_maxsize = 0; bool need_unlock = false;