summaryrefslogtreecommitdiffstats
path: root/test/unit/pages.c
diff options
context:
space:
mode:
authorJoerg Koenig <jck@techsat.com>2018-01-19 10:53:15 (GMT)
committerJoerg Koenig <jck@techsat.com>2018-01-19 10:53:15 (GMT)
commitaa502047980c13cdbe5a1adb7f024199c367254d (patch)
tree8cc6a214bde51a42beb77ac92fe0d00dd44c0c90 /test/unit/pages.c
parent3f5049340e66c6929c3270f7359617f62e053b11 (diff)
parentf78d4ca3fbff6cab0c704c787706a53ddafcbe13 (diff)
downloadjemalloc-master.zip
jemalloc-master.tar.gz
jemalloc-master.tar.bz2
Merge https://github.com/jemalloc/jemallocHEADmaster
Change-Id: I44881ca21f4710f7ad5154a45c4a7204ae71c84c
Diffstat (limited to 'test/unit/pages.c')
-rw-r--r--test/unit/pages.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/unit/pages.c b/test/unit/pages.c
index 67dbb4c..49ad009 100644
--- a/test/unit/pages.c
+++ b/test/unit/pages.c
@@ -10,11 +10,13 @@ TEST_BEGIN(test_pages_huge) {
pages = pages_map(NULL, alloc_size, PAGE, &commit);
assert_ptr_not_null(pages, "Unexpected pages_map() error");
- hugepage = (void *)(ALIGNMENT_CEILING((uintptr_t)pages, HUGEPAGE));
- assert_b_ne(pages_huge(hugepage, HUGEPAGE), config_thp,
- "Unexpected pages_huge() result");
- assert_false(pages_nohuge(hugepage, HUGEPAGE),
- "Unexpected pages_nohuge() result");
+ if (thp_state_madvise) {
+ hugepage = (void *)(ALIGNMENT_CEILING((uintptr_t)pages, HUGEPAGE));
+ assert_b_ne(pages_huge(hugepage, HUGEPAGE), have_madvise_huge,
+ "Unexpected pages_huge() result");
+ assert_false(pages_nohuge(hugepage, HUGEPAGE),
+ "Unexpected pages_nohuge() result");
+ }
pages_unmap(pages, alloc_size);
}