diff options
| author | Jason Evans <jasone@canonware.com> | 2017-06-13 19:49:58 (GMT) |
|---|---|---|
| committer | Jason Evans <jasone@canonware.com> | 2017-06-13 19:51:09 (GMT) |
| commit | 5018fe3f0979b7f9db9930accdf7ee31071fd703 (patch) | |
| tree | 894055b5ff4ccde3d9d782861d45af4664f12ad2 /test/unit/pages.c | |
| parent | 04380e79f1e2428bd0ad000bbc6e3d2dfc6b66a5 (diff) | |
| parent | ba29113e5a58caeb6b4a65b1db6d8efae79cae45 (diff) | |
| download | jemalloc-5.0.0.zip jemalloc-5.0.0.tar.gz jemalloc-5.0.0.tar.bz2 | |
Merge branch 'dev'5.0.0
Diffstat (limited to 'test/unit/pages.c')
| -rw-r--r-- | test/unit/pages.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/test/unit/pages.c b/test/unit/pages.c index d31a35e..67dbb4c 100644 --- a/test/unit/pages.c +++ b/test/unit/pages.c @@ -1,27 +1,27 @@ #include "test/jemalloc_test.h" -TEST_BEGIN(test_pages_huge) -{ +TEST_BEGIN(test_pages_huge) { + size_t alloc_size; bool commit; - void *pages; + void *pages, *hugepage; + alloc_size = HUGEPAGE * 2 - PAGE; commit = true; - pages = pages_map(NULL, PAGE, &commit); + pages = pages_map(NULL, alloc_size, PAGE, &commit); assert_ptr_not_null(pages, "Unexpected pages_map() error"); - assert_false(pages_huge(pages, PAGE), + 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(pages, PAGE), + assert_false(pages_nohuge(hugepage, HUGEPAGE), "Unexpected pages_nohuge() result"); - pages_unmap(pages, PAGE); + pages_unmap(pages, alloc_size); } TEST_END int -main(void) -{ - - return (test( - test_pages_huge)); +main(void) { + return test( + test_pages_huge); } |
