[llvm-commits] [compiler-rt] r161322 - /compiler-rt/trunk/lib/asan/asan_malloc_linux.cc

Alexey Samsonov samsonov at google.com
Mon Aug 6 08:13:22 PDT 2012


Author: samsonov
Date: Mon Aug  6 10:13:22 2012
New Revision: 161322

URL: http://llvm.org/viewvc/llvm-project?rev=161322&view=rev
Log:
[ASan] fix names of malloc/free replacements on Android

Modified:
    compiler-rt/trunk/lib/asan/asan_malloc_linux.cc

Modified: compiler-rt/trunk/lib/asan/asan_malloc_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_malloc_linux.cc?rev=161322&r1=161321&r2=161322&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_malloc_linux.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_malloc_linux.cc Mon Aug  6 10:13:22 2012
@@ -21,6 +21,12 @@
 #include "asan_stack.h"
 
 #ifdef ANDROID
+DECLARE_REAL_AND_INTERCEPTOR(void*, malloc, uptr size);
+DECLARE_REAL_AND_INTERCEPTOR(void, free, void *ptr);
+DECLARE_REAL_AND_INTERCEPTOR(void*, calloc, uptr nmemb, uptr size);
+DECLARE_REAL_AND_INTERCEPTOR(void*, realloc, void *ptr, uptr size);
+DECLARE_REAL_AND_INTERCEPTOR(void*, memalign, uptr boundary, uptr size);
+
 struct MallocDebug {
   void* (*malloc)(uptr bytes);
   void  (*free)(void* mem);
@@ -30,7 +36,7 @@
 };
 
 const MallocDebug asan_malloc_dispatch ALIGNED(32) = {
-  malloc, free, calloc, realloc, memalign
+  WRAP(malloc), WRAP(free), WRAP(calloc), WRAP(realloc), WRAP(memalign)
 };
 
 extern "C" const MallocDebug* __libc_malloc_dispatch;





More information about the llvm-commits mailing list