From acaa1d82d90c944d40d4e94d2990c6de84e3d9aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Sat, 5 Nov 2022 14:04:38 +0300 Subject: [PATCH] mdbx: minor touch assertions for `issue#7`. https://gitflic.ru/project/erthink/libmdbx/issue/7 --- src/core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core.c b/src/core.c index bef4dd5e..60b060b9 100644 --- a/src/core.c +++ b/src/core.c @@ -5934,6 +5934,9 @@ __cold static int map_resize(MDBX_env *env, const pgno_t used_pgno, #if MDBX_ENABLE_MADVISE if (rc == MDBX_SUCCESS) { + eASSERT(env, limit_bytes == env->me_dxb_mmap.limit); + eASSERT(env, size_bytes <= env->me_dxb_mmap.filesize); + eASSERT(env, size_bytes == env->me_dxb_mmap.current); env->me_lck->mti_discarded_tail.weak = size_pgno; const bool readahead = !(env->me_flags & MDBX_NORDAHEAD) && @@ -5950,9 +5953,9 @@ __cold static int map_resize(MDBX_env *env, const pgno_t used_pgno, bailout: if (rc == MDBX_SUCCESS) { - eASSERT(env, size_bytes == env->me_dxb_mmap.current); - eASSERT(env, size_bytes <= env->me_dxb_mmap.filesize); eASSERT(env, limit_bytes == env->me_dxb_mmap.limit); + eASSERT(env, size_bytes <= env->me_dxb_mmap.filesize); + eASSERT(env, size_bytes == env->me_dxb_mmap.current); #ifdef MDBX_USE_VALGRIND if (prev_limit != env->me_dxb_mmap.limit || prev_addr != env->me_map) { VALGRIND_DISCARD(env->me_valgrind_handle);