diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp index 40056c21ee3bb..4656c5490cfba 100644 --- a/core/jni/com_android_internal_os_Zygote.cpp +++ b/core/jni/com_android_internal_os_Zygote.cpp @@ -73,6 +73,7 @@ #include #include #include +#include #include #include #include @@ -493,12 +494,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);