Pages: Statically detect if pages_huge may succeed

This commit is contained in:
David Goldblatt 2020-12-05 09:10:15 -08:00 committed by David Goldblatt
parent c1b2a77933
commit 63677dde63

View File

@ -58,6 +58,18 @@ static const bool pages_can_purge_forced =
#endif
;
#if defined(JEMALLOC_HAVE_MADVISE_HUGE) || defined(JEMALLOC_HAVE_MEMCNTL)
# define PAGES_CAN_HUGIFY
#endif
static const bool pages_can_hugify =
#ifdef PAGES_CAN_HUGIFY
true
#else
false
#endif
;
typedef enum {
thp_mode_default = 0, /* Do not change hugepage settings. */
thp_mode_always = 1, /* Always set MADV_HUGEPAGE. */