From 347a2b7cd4514ed358455f57ff3f469e9aadfa5b Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Thu, 13 Nov 2014 09:15:15 +0000 Subject: [PATCH] [ASan] Fix large allocator test case to cope with 64k pages Summary: My PowerPC64 Linux box has 64k pages. The test assumes 4k pages. Fix it. Reviewers: glider, eugenis, samsonov Reviewed By: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6228 llvm-svn: 221875 --- .../test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler-rt/test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc b/compiler-rt/test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc index ff45caa..0a49980 100644 --- a/compiler-rt/test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc +++ b/compiler-rt/test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc @@ -8,6 +8,7 @@ #include #include #include +#include #ifdef __ANDROID__ #include @@ -23,7 +24,7 @@ void *my_memalign(size_t boundary, size_t size) { #endif int main() { - const int kPageSize = 4096; + const long kPageSize = sysconf(_SC_PAGESIZE); void *p = my_memalign(kPageSize, 1024 * 1024); free(p); -- 2.7.4