Support AutoConf for posix_madvise and POSIX_MADV_DONTNEED
This commit is contained in:
parent
96a59c3bb5
commit
26c1dc5a3a
20
configure.ac
20
configure.ac
@ -2204,6 +2204,26 @@ case "${host_cpu}" in
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
else
|
||||
dnl Check for posix_madvise.
|
||||
JE_COMPILABLE([posix_madvise], [
|
||||
#include <sys/mman.h>
|
||||
], [
|
||||
posix_madvise((void *)0, 0, 0);
|
||||
], [je_cv_posix_madvise])
|
||||
if test "x${je_cv_posix_madvise}" = "xyes" ; then
|
||||
AC_DEFINE([JEMALLOC_HAVE_POSIX_MADVISE], [ ])
|
||||
|
||||
dnl Check for posix_madvise(..., POSIX_MADV_DONTNEED).
|
||||
JE_COMPILABLE([posix_madvise(..., POSIX_MADV_DONTNEED)], [
|
||||
#include <sys/mman.h>
|
||||
], [
|
||||
posix_madvise((void *)0, 0, POSIX_MADV_DONTNEED);
|
||||
], [je_cv_posix_madv_dontneed])
|
||||
if test "x${je_cv_posix_madv_dontneed}" = "xyes" ; then
|
||||
AC_DEFINE([JEMALLOC_PURGE_POSIX_MADVISE_DONTNEED], [ ])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl ============================================================================
|
||||
|
@ -318,6 +318,17 @@
|
||||
*/
|
||||
#undef JEMALLOC_THP
|
||||
|
||||
/* Defined if posix_madvise is available. */
|
||||
#undef JEMALLOC_HAVE_POSIX_MADVISE
|
||||
|
||||
/*
|
||||
* Method for purging unused pages using posix_madvise.
|
||||
*
|
||||
* posix_madvise(..., POSIX_MADV_DONTNEED)
|
||||
*/
|
||||
#undef JEMALLOC_PURGE_POSIX_MADVISE_DONTNEED
|
||||
#undef JEMALLOC_PURGE_POSIX_MADVISE_DONTNEED_ZEROS
|
||||
|
||||
/*
|
||||
* Defined if memcntl page admin call is supported
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user