From 03863f1bee83f43c2dfa7299151e2631fed31813 Mon Sep 17 00:00:00 2001 From: Robo Date: Thu, 21 Apr 2022 05:52:15 +0900 Subject: [PATCH] fix: adopt partition alloc early initialization (#33832) Refs https://chromium-review.googlesource.com/c/chromium/src/+/3298858 --- BUILD.gn | 6 +++++- shell/app/electron_main_mac.cc | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/BUILD.gn b/BUILD.gn index 53096fff480c3..039250e5a955a 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -916,7 +916,10 @@ if (is_mac) { assert(defined(invoker.helper_name_suffix)) output_name = electron_helper_name + invoker.helper_name_suffix - deps = [ ":electron_framework+link" ] + deps = [ + ":electron_framework+link", + "//base/allocator:early_zone_registration_mac", + ] if (!is_mas_build) { deps += [ "//sandbox/mac:seatbelt" ] } @@ -1077,6 +1080,7 @@ if (is_mac) { ":electron_app_plist", ":electron_app_resources", ":electron_fuses", + "//base/allocator:early_zone_registration_mac", "//electron/buildflags", ] if (is_mas_build) { diff --git a/shell/app/electron_main_mac.cc b/shell/app/electron_main_mac.cc index c0f9576fff7fe..c040db6624c63 100644 --- a/shell/app/electron_main_mac.cc +++ b/shell/app/electron_main_mac.cc @@ -5,6 +5,7 @@ #include #include +#include "base/allocator/early_zone_registration_mac.h" #include "electron/buildflags/buildflags.h" #include "electron/fuses.h" #include "shell/app/electron_library_main.h" @@ -28,6 +29,7 @@ namespace { } // namespace int main(int argc, char* argv[]) { + partition_alloc::EarlyMallocZoneRegistration(); FixStdioStreams(); #if BUILDFLAG(ENABLE_RUN_AS_NODE)