From 8a3c2614b68cc2a8bf479a808dc78cb538391ac8 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Tue, 9 Apr 2019 16:42:32 -0700 Subject: [PATCH] Remove gMallocLeakZygoteChild. Bug: 130028357 Test: Verified that call is made and that memory is properly marked in a Test: child as not in the Zygote. Change-Id: I9b94637cc0e48eec3bbccfdc1afd531a1ee10a89 (cherry picked from commit ed364d6caa067ea46a07e9530fd01212b99aeaad) --- core/jni/com_android_internal_os_Zygote.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp index 0e5f53b87049..04d270676566 100644 --- a/core/jni/com_android_internal_os_Zygote.cpp +++ b/core/jni/com_android_internal_os_Zygote.cpp @@ -72,6 +72,7 @@ #include #include #include +#include #include #include #include @@ -476,12 +477,9 @@ static void EnableDebugger() { } } -// The debug malloc library needs to know whether it's the zygote or a child. -extern "C" int gMallocLeakZygoteChild; - static void PreApplicationInit() { // The child process sets this to indicate it's not the zygote. - gMallocLeakZygoteChild = 1; + android_mallopt(M_SET_ZYGOTE_CHILD, nullptr, 0); // Set the jemalloc decay time to 1. mallopt(M_DECAY_TIME, 1); -- 2.11.0