[asan] Replace posix_memalign with memalign in test.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Fri, 14 Feb 2014 15:02:36 +0000 (15:02 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Fri, 14 Feb 2014 15:02:36 +0000 (15:02 +0000)
Android does not provide posix_memalign.

llvm-svn: 201420

compiler-rt/test/asan/TestCases/large_allocator_unpoisons_on_free.cc

index d1499d2..f95cc44 100644 (file)
@@ -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);