From 65defdd0a8f1f83d4b0f8d6be1e8c07558cc77e8 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Tue, 1 Feb 2022 16:06:56 +0300 Subject: [PATCH] mdbx-test: fix calculation default `size_now` of DB. --- test/main.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/main.cc b/test/main.cc index fe67c103..c201c20e 100644 --- a/test/main.cc +++ b/test/main.cc @@ -134,9 +134,8 @@ void actor_params::set_defaults(const std::string &tmpdir) { table_flags = MDBX_DUPSORT; size_lower = -1; - size_now = - intptr_t(1024) * 1024 * ((table_flags & MDBX_DUPSORT) ? 256 : 1024); - size_now = std::max(size_now, mdbx_limits_dbsize_max(-1)); + size_now = intptr_t((table_flags & MDBX_DUPSORT) ? 256 : 1024) << 20; + size_now = std::min(size_now, mdbx_limits_dbsize_max(-1)); size_upper = -1; shrink_threshold = -1; growth_step = -1;