OSDN Git Service
(root)
/
android-x86
/
bionic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b6cdb5
)
malloc_usable_size returns the original size.
author
Christopher Ferris
<cferris@google.com>
Thu, 14 Aug 2014 19:48:04 +0000
(12:48 -0700)
committer
Christopher Ferris
<cferris@google.com>
Mon, 18 Aug 2014 20:10:16 +0000
(13:10 -0700)
Bug:
16874447
(cherry picked from commit
59c1ee44d0a560a754513fab12641c8a57a20d9e
)
Change-Id: I70839632974367c8b9893fb1f9c5ee4364608470
libc/bionic/malloc_debug_leak.cpp
patch
|
blob
|
history
diff --git
a/libc/bionic/malloc_debug_leak.cpp
b/libc/bionic/malloc_debug_leak.cpp
index
837dccc
..
27b6714
100644
(file)
--- 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;
}