mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 19:44:13 +08:00
mdbx: minor fix auto-readahead for buggy platforms (i.e. DragonflyBSD, NetBSD).
This commit is contained in:
parent
6da4c1f06b
commit
51440b5542
@ -3595,12 +3595,11 @@ static __cold int mdbx_mapresize(MDBX_env *env, const pgno_t size_pgno,
|
||||
|
||||
rc = mdbx_mresize(env->me_flags, &env->me_dxb_mmap, size_bytes, limit_bytes);
|
||||
if (rc == MDBX_SUCCESS && (env->me_flags & MDBX_NORDAHEAD) == 0) {
|
||||
rc = mdbx_is_readahead_reasonable(size_bytes, 0);
|
||||
if (rc == MDBX_RESULT_FALSE)
|
||||
const int readahead = mdbx_is_readahead_reasonable(size_bytes, 0);
|
||||
if (readahead == MDBX_RESULT_FALSE)
|
||||
rc = mdbx_set_readahead(
|
||||
env, 0, (size_bytes > prev_size) ? size_bytes : prev_size, false);
|
||||
else if (rc == MDBX_RESULT_TRUE) {
|
||||
rc = MDBX_SUCCESS;
|
||||
else if (readahead == MDBX_RESULT_TRUE) {
|
||||
const size_t readahead_pivot =
|
||||
(limit_bytes != prev_limit || env->me_dxb_mmap.address != prev_addr
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
|
Loading…
x
Reference in New Issue
Block a user