[compiler-rt] r221875 - [ASan] Fix large allocator test case to cope with 64k pages

Jay Foad jay.foad at gmail.com
Thu Nov 13 01:15:15 PST 2014


Author: foad
Date: Thu Nov 13 03:15:15 2014
New Revision: 221875

URL: http://llvm.org/viewvc/llvm-project?rev=221875&view=rev
Log:
[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

Modified:
    compiler-rt/trunk/test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc

Modified: compiler-rt/trunk/test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc?rev=221875&r1=221874&r2=221875&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Posix/large_allocator_unpoisons_on_free.cc Thu Nov 13 03:15:15 2014
@@ -8,6 +8,7 @@
 #include <string.h>
 #include <sys/mman.h>
 #include <stdlib.h>
+#include <unistd.h>
 
 #ifdef __ANDROID__
 #include <malloc.h>
@@ -23,7 +24,7 @@ void *my_memalign(size_t boundary, size_
 #endif
 
 int main() {
-  const int kPageSize = 4096;
+  const long kPageSize = sysconf(_SC_PAGESIZE);
   void *p = my_memalign(kPageSize, 1024 * 1024);
   free(p);
 





More information about the llvm-commits mailing list