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)
diff --git a/libc/malloc_debug/PointerData.h b/libc/malloc_debug/PointerData.h
index 24ca748..c7958f3 100644
--- a/libc/malloc_debug/PointerData.h
+++ b/libc/malloc_debug/PointerData.h
@@ -44,7 +44,7 @@
#include "OptionData.h"
#include "UnwindBacktrace.h"
-extern int* g_malloc_zygote_child;
+extern bool* g_zygote_child;
// Forward declarations.
class Config;
@@ -89,7 +89,9 @@
size_t hash_index;
size_t RealSize() const { return size & ~(1U << 31); }
bool ZygoteChildAlloc() const { return size & (1U << 31); }
- static size_t GetEncodedSize(size_t size) { return GetEncodedSize(*g_malloc_zygote_child, size); }
+ static size_t GetEncodedSize(size_t size) {
+ return GetEncodedSize(*g_zygote_child, size);
+ }
static size_t GetEncodedSize(bool child_alloc, size_t size) {
return size | ((child_alloc) ? (1U << 31) : 0);
}