diff --git a/src/core.c b/src/core.c index d8b22159..9380f4d8 100644 --- a/src/core.c +++ b/src/core.c @@ -4747,18 +4747,18 @@ static __cold int mdbx_mapresize(MDBX_env *env, const pgno_t used_pgno, const size_t limit_bytes = pgno_align2os_bytes(env, limit_pgno); const size_t size_bytes = pgno_align2os_bytes(env, size_pgno); + const size_t prev_size = env->me_dxb_mmap.current; + const size_t prev_limit = env->me_dxb_mmap.limit; + const void *const prev_addr = env->me_map; mdbx_verbose("resize datafile/mapping: " "present %" PRIuPTR " -> %" PRIuPTR ", " "limit %" PRIuPTR " -> %" PRIuPTR, - env->me_dxb_mmap.current, size_bytes, env->me_dxb_mmap.limit, - limit_bytes); + prev_size, size_bytes, prev_limit, limit_bytes); mdbx_assert(env, limit_bytes >= size_bytes); mdbx_assert(env, bytes2pgno(env, size_bytes) >= size_pgno); mdbx_assert(env, bytes2pgno(env, limit_bytes) >= limit_pgno); - const size_t prev_limit = env->me_dxb_mmap.limit; - const void *const prev_addr = env->me_map; #if defined(_WIN32) || defined(_WIN64) /* Acquire guard in exclusive mode for: @@ -4825,7 +4825,6 @@ static __cold int mdbx_mapresize(MDBX_env *env, const pgno_t used_pgno, #endif /* ! Windows */ - const size_t prev_size = env->me_dxb_mmap.current; if (size_bytes < prev_size) { mdbx_notice("resize-MADV_%s %u..%u", (env->me_flags & MDBX_WRITEMAP) ? "REMOVE" : "DONTNEED", @@ -4908,14 +4907,12 @@ bailout: mdbx_error("failed resize datafile/mapping: " "present %" PRIuPTR " -> %" PRIuPTR ", " "limit %" PRIuPTR " -> %" PRIuPTR ", errcode %d", - env->me_dxb_mmap.current, size_bytes, env->me_dxb_mmap.limit, - limit_bytes, rc); + prev_size, size_bytes, prev_limit, limit_bytes, rc); } else { mdbx_warning("unable resize datafile/mapping: " "present %" PRIuPTR " -> %" PRIuPTR ", " "limit %" PRIuPTR " -> %" PRIuPTR ", errcode %d", - env->me_dxb_mmap.current, size_bytes, env->me_dxb_mmap.limit, - limit_bytes, rc); + prev_size, size_bytes, prev_limit, limit_bytes, rc); } if (!env->me_dxb_mmap.address) { env->me_flags |= MDBX_FATAL_ERROR;