summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2014-06-09 08:36:14 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2014-06-09 08:36:14 +0000
commit63ece03c57fc84385f94f35c023ef9b8cfc6f16b (patch)
tree12e7e088a6b564e0ad65db623f1ce5fc630fc9f3
parent2ad8c22a555f69d807210b042731aaa4ecc290dc (diff)
downloadbcm5719-llvm-63ece03c57fc84385f94f35c023ef9b8cfc6f16b.tar.gz
bcm5719-llvm-63ece03c57fc84385f94f35c023ef9b8cfc6f16b.zip
[asan] Add malloc_usable_size to android malloc dispatch.
llvm-svn: 210452
-rw-r--r--compiler-rt/lib/asan/asan_malloc_linux.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/compiler-rt/lib/asan/asan_malloc_linux.cc b/compiler-rt/lib/asan/asan_malloc_linux.cc
index 4d60bfc3cb6..0c368d81a4d 100644
--- a/compiler-rt/lib/asan/asan_malloc_linux.cc
+++ b/compiler-rt/lib/asan/asan_malloc_linux.cc
@@ -29,18 +29,20 @@ 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)
+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() {
OpenPOWER on IntegriCloud