diff options
author | Qi Wang <interwq@gwu.edu> | 2017-08-11 22:41:52 (GMT) |
---|---|---|
committer | Qi Wang <interwq@gmail.com> | 2017-08-11 22:57:12 (GMT) |
commit | 3ec279ba1c702286b2a7d4ce7aaf48d7905f1c5b (patch) | |
tree | d4777143d2244dfe788c23bc0f341e1fa0c3443b /src | |
parent | 8fdd9a579779b84d6af27f94c295f82a4df8e5be (diff) | |
download | jemalloc-3ec279ba1c702286b2a7d4ce7aaf48d7905f1c5b.zip jemalloc-3ec279ba1c702286b2a7d4ce7aaf48d7905f1c5b.tar.gz jemalloc-3ec279ba1c702286b2a7d4ce7aaf48d7905f1c5b.tar.bz2 |
Fix test/unit/pages.
As part of the metadata_thp support, We now have a separate swtich
(JEMALLOC_HAVE_MADVISE_HUGE) for MADV_HUGEPAGE availability. Use that instead
of JEMALLOC_THP (which doesn't guard pages_huge anymore) in tests.
Diffstat (limited to 'src')
-rw-r--r-- | src/pages.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/pages.c b/src/pages.c index 9561f6d..70f1fd3 100644 --- a/src/pages.c +++ b/src/pages.c @@ -417,13 +417,14 @@ os_overcommits_proc(void) { static void init_thp_state(void) { -#ifndef JEMALLOC_HAVE_MADVISE_HUGE - if (opt_metadata_thp && opt_abort) { - malloc_write("<jemalloc>: no MADV_HUGEPAGE support\n"); - abort(); + if (!have_madvise_huge) { + if (opt_metadata_thp && opt_abort) { + malloc_write("<jemalloc>: no MADV_HUGEPAGE support\n"); + abort(); + } + goto label_error; } - goto label_error; -#endif + static const char madvise_state[] = "always [madvise] never\n"; char buf[sizeof(madvise_state)]; |