mdbx: правка rthc_afterfork() для Valgrind.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2023-11-27 12:35:20 +03:00
parent 43dbf8ec4f
commit 349759648d

View File

@ -26320,8 +26320,15 @@ __cold static void rthc_afterfork(void) {
for (size_t i = 0; i < rthc_count; ++i) {
MDBX_env *const env = rthc_table[i].env;
NOTICE("drown env %p", __Wpedantic_format_voidptr(env));
env->me_dxb_mmap.base = nullptr;
env->me_lck_mmap.base = nullptr;
if (env->me_lck_mmap.lck)
osal_munmap(&env->me_lck_mmap);
if (env->me_map) {
osal_munmap(&env->me_dxb_mmap);
#ifdef ENABLE_MEMCHECK
VALGRIND_DISCARD(env->me_valgrind_handle);
env->me_valgrind_handle = -1;
#endif /* ENABLE_MEMCHECK */
}
env->me_lck = lckless_stub(env);
rthc_drown(env);
}