mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-01 23:34:13 +08:00
mdbx: fix madvise() flags.
Change-Id: If0ed3cd972fbc0caea486656ae05526aa2022574
This commit is contained in:
parent
2477997658
commit
c9c0549b4f
16
mdb.c
16
mdb.c
@ -4731,13 +4731,23 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl)
|
||||
return errno;
|
||||
env->me_txns = m;
|
||||
|
||||
if (madvise(env->me_txns, rsize, MADV_DONTFORK | MADV_WILLNEED))
|
||||
return errno;
|
||||
#ifdef MADV_NOHUGEPAGE
|
||||
(void) madvise(env->me_txns, rsize, MADV_NOHUGEPAGE);
|
||||
#endif
|
||||
|
||||
#ifdef MADV_DODUMP
|
||||
madvise(env->me_txns, rsize, MADV_DODUMP);
|
||||
(void) madvise(env->me_txns, rsize, MADV_DODUMP);
|
||||
#endif
|
||||
|
||||
if (madvise(env->me_txns, rsize, MADV_DONTFORK) < 0)
|
||||
return errno;
|
||||
|
||||
if (madvise(env->me_txns, rsize, MADV_WILLNEED) < 0)
|
||||
return errno;
|
||||
|
||||
if (madvise(env->me_txns, rsize, MADV_RANDOM) < 0)
|
||||
return errno;
|
||||
|
||||
if (*excl > 0) {
|
||||
pthread_mutexattr_t mattr;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user