From 48bd3fc4c8e9eb221d8651f6a9638bd7ec88be9e 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: Wed, 28 Dec 2022 16:25:04 +0300 Subject: [PATCH] =?UTF-8?q?mdbx:=20=D1=83=D0=BF=D1=80=D0=BE=D1=89=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20`default=5Fprefault=5Fwrite()`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/core.c b/src/core.c index 62d2cc65..2758e524 100644 --- a/src/core.c +++ b/src/core.c @@ -5963,11 +5963,8 @@ __cold static unsigned default_rp_augment_limit(const MDBX_env *env) { } __cold static bool default_prefault_write(const MDBX_env *env) { - if (env->me_incore || - (env->me_flags & (MDBX_WRITEMAP | MDBX_RDONLY)) != MDBX_WRITEMAP) - return false; - - return !MDBX_MMAP_INCOHERENT_FILE_WRITE; + return !MDBX_MMAP_INCOHERENT_FILE_WRITE && !env->me_incore && + (env->me_flags & (MDBX_WRITEMAP | MDBX_RDONLY)) == MDBX_WRITEMAP; } static void adjust_defaults(MDBX_env *env) {