summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2014-08-14 21:43:11 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-14 16:46:52 +0000
commit0533195e16b86794f14dfb1800ca170ce2548b9f (patch)
treed7f3af0fff184c2f52f56c6cc4558d07ff7d375c /libc
parent4bea4c631f747cc6b570ecd42c744a9b1103bf28 (diff)
parent59c1ee44d0a560a754513fab12641c8a57a20d9e (diff)
downloadbionic-0533195e16b86794f14dfb1800ca170ce2548b9f.zip
bionic-0533195e16b86794f14dfb1800ca170ce2548b9f.tar.gz
bionic-0533195e16b86794f14dfb1800ca170ce2548b9f.tar.bz2
Merge "malloc_usable_size returns the original size." into lmp-dev
Diffstat (limited to 'libc')
-rw-r--r--libc/bionic/malloc_debug_leak.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libc/bionic/malloc_debug_leak.cpp b/libc/bionic/malloc_debug_leak.cpp
index 837dccc..27b6714 100644
--- a/libc/bionic/malloc_debug_leak.cpp
+++ b/libc/bionic/malloc_debug_leak.cpp
@@ -481,11 +481,15 @@ extern "C" size_t leak_malloc_usable_size(const void* mem) {
return 0;
}
+ // TODO: Temporary workaround to avoid a crash b/16874447.
+ return header->entry->size & ~SIZE_FLAG_MASK;
+#if 0
size_t ret = g_malloc_dispatch->malloc_usable_size(header);
if (ret != 0) {
// The usable area starts at 'mem' and stops at 'header+ret'.
return reinterpret_cast<uintptr_t>(header) + ret - reinterpret_cast<uintptr_t>(mem);
}
+#endif
}
return 0;
}