mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 17:34:14 +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;
|
return errno;
|
||||||
env->me_txns = m;
|
env->me_txns = m;
|
||||||
|
|
||||||
if (madvise(env->me_txns, rsize, MADV_DONTFORK | MADV_WILLNEED))
|
#ifdef MADV_NOHUGEPAGE
|
||||||
return errno;
|
(void) madvise(env->me_txns, rsize, MADV_NOHUGEPAGE);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef MADV_DODUMP
|
#ifdef MADV_DODUMP
|
||||||
madvise(env->me_txns, rsize, MADV_DODUMP);
|
(void) madvise(env->me_txns, rsize, MADV_DODUMP);
|
||||||
#endif
|
#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) {
|
if (*excl > 0) {
|
||||||
pthread_mutexattr_t mattr;
|
pthread_mutexattr_t mattr;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user