[compiler-rt] r201420 - [asan] Replace posix_memalign with memalign in test.

Evgeniy Stepanov eugeni.stepanov at gmail.com
Fri Feb 14 07:02:36 PST 2014


Author: eugenis
Date: Fri Feb 14 09:02:36 2014
New Revision: 201420

URL: http://llvm.org/viewvc/llvm-project?rev=201420&view=rev
Log:
[asan] Replace posix_memalign with memalign in test.

Android does not provide posix_memalign.

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

Modified: compiler-rt/trunk/test/asan/TestCases/large_allocator_unpoisons_on_free.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/large_allocator_unpoisons_on_free.cc?rev=201420&r1=201419&r2=201420&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/large_allocator_unpoisons_on_free.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/large_allocator_unpoisons_on_free.cc Fri Feb 14 09:02:36 2014
@@ -5,14 +5,13 @@
 // RUN: ASAN_OPTIONS=quarantine_size=1 %t
 
 #include <assert.h>
-#include <stdlib.h>
+#include <malloc.h>
 #include <string.h>
 #include <sys/mman.h>
 
 int main() {
   const int kPageSize = 4096;
-  void *p = NULL;
-  posix_memalign(&p, kPageSize, 1024 * 1024);
+  void *p = memalign(kPageSize, 1024 * 1024);
   free(p);
 
   char *q = (char *)mmap(p, kPageSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_FIXED, 0, 0);





More information about the llvm-commits mailing list