summaryrefslogtreecommitdiff
path: root/libc/malloc_debug/malloc_debug.cpp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2019-04-09 16:37:23 -0700
committerChristopher Ferris <cferris@google.com>2019-04-16 10:59:36 -0700
commitab1c43dd6da311a2df0d5fdf55d3971df64384cb (patch)
treea4fbe91cbf7b6c5add64eaa84163a5fab4789504 /libc/malloc_debug/malloc_debug.cpp
parentc8c4babc33a84dabba513d4b7243f1dd3d2ea443 (diff)
Remove gMallocLeakZygoteChild.
Remove this global variable and change the setting of it to non-zero to a call to android_mallopt. In addition, change the initialize function to use pass a bool* instead of int*. Bug: 130028357 Test: Ran malloc_debug/malloc_hooks/perfetto tests. Change-Id: I20d382bdeaaf38aac6b9dcabea5b3dfab3c945f6 Merged-In: I20d382bdeaaf38aac6b9dcabea5b3dfab3c945f6 (cherry picked from commit 5225b342f0810c027df3d09fbbcef4d324b19b93)
Diffstat (limited to 'libc/malloc_debug/malloc_debug.cpp')
-rw-r--r--libc/malloc_debug/malloc_debug.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libc/malloc_debug/malloc_debug.cpp b/libc/malloc_debug/malloc_debug.cpp
index 114579626..91e1d2610 100644
--- a/libc/malloc_debug/malloc_debug.cpp
+++ b/libc/malloc_debug/malloc_debug.cpp
@@ -58,7 +58,7 @@
// ------------------------------------------------------------------------
DebugData* g_debug;
-int* g_malloc_zygote_child;
+bool* g_zygote_child;
const MallocDispatch* g_dispatch;
// ------------------------------------------------------------------------
@@ -70,7 +70,7 @@ const MallocDispatch* g_dispatch;
// ------------------------------------------------------------------------
__BEGIN_DECLS
-bool debug_initialize(const MallocDispatch* malloc_dispatch, int* malloc_zygote_child,
+bool debug_initialize(const MallocDispatch* malloc_dispatch, bool* malloc_zygote_child,
const char* options);
void debug_finalize();
void debug_dump_heap(const char* file_name);
@@ -225,15 +225,15 @@ static void* InitHeader(Header* header, void* orig_pointer, size_t size) {
return g_debug->GetPointer(header);
}
-bool debug_initialize(const MallocDispatch* malloc_dispatch, int* malloc_zygote_child,
+bool debug_initialize(const MallocDispatch* malloc_dispatch, bool* zygote_child,
const char* options) {
- if (malloc_zygote_child == nullptr || options == nullptr) {
+ if (zygote_child == nullptr || options == nullptr) {
return false;
}
InitAtfork();
- g_malloc_zygote_child = malloc_zygote_child;
+ g_zygote_child = zygote_child;
g_dispatch = malloc_dispatch;