[compiler-rt] r210452 - [asan] Add malloc_usable_size to android malloc dispatch.
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Mon Jun 9 01:36:14 PDT 2014
Author: eugenis
Date: Mon Jun 9 03:36:14 2014
New Revision: 210452
URL: http://llvm.org/viewvc/llvm-project?rev=210452&view=rev
Log:
[asan] Add malloc_usable_size to android malloc dispatch.
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=210452&r1=210451&r2=210452&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_malloc_linux.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_malloc_linux.cc Mon Jun 9 03:36:14 2014
@@ -29,18 +29,20 @@ DECLARE_REAL_AND_INTERCEPTOR(void, free,
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)
+DECLARE_REAL_AND_INTERCEPTOR(uptr, malloc_usable_size, void *mem)
struct MallocDebug {
- void* (*malloc)(uptr bytes);
- void (*free)(void* mem);
- void* (*calloc)(uptr n_elements, uptr elem_size);
- void* (*realloc)(void* oldMem, uptr bytes);
- void* (*memalign)(uptr alignment, uptr bytes);
+ void *(*malloc)(uptr bytes);
+ void (*free)(void *mem);
+ void *(*calloc)(uptr n_elements, uptr elem_size);
+ void *(*realloc)(void *oldMem, uptr bytes);
+ void *(*memalign)(uptr alignment, uptr bytes);
+ uptr (*malloc_usable_size)(void *mem);
};
-const MallocDebug asan_malloc_dispatch ALIGNED(32) = {
- WRAP(malloc), WRAP(free), WRAP(calloc), WRAP(realloc), WRAP(memalign)
-};
+ALIGNED(32) const MallocDebug asan_malloc_dispatch = {
+ WRAP(malloc), WRAP(free), WRAP(calloc),
+ WRAP(realloc), WRAP(memalign), WRAP(malloc_usable_size)};
namespace __asan {
void ReplaceSystemMalloc() {
More information about the llvm-commits
mailing list