Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 1671063002: Enable deferred free for syzyasan builds behind a feature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/common/chrome_features.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 2c58ed641a810543f2a17f43fcff315baa001075..1c5a6acf28ceee856b95d0beab15b439e733e013 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -93,6 +93,7 @@
#include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/chrome_constants.h"
+#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_result_codes.h"
#include "chrome/common/chrome_switches.h"
@@ -1204,6 +1205,28 @@ void ChromeBrowserMainParts::PreBrowserStart() {
three_d_observer_.reset(new ThreeDAPIObserver());
+#if defined(SYZYASAN)
+ // Enable the deferred free mechanism in the syzyasan module, which helps the
+ // performance by deferring some work on the critical path to a background
+ // thread.
+ if (base::FeatureList::IsEnabled(features::kSyzyasanDeferredFree)) {
+ typedef VOID(WINAPI * SyzyasanEnableDeferredFreeThreadFunc)(VOID);
+ HMODULE syzyasan_handle = ::GetModuleHandle(L"syzyasan_rtl.dll");
+ bool success = false;
+ if (syzyasan_handle) {
+ SyzyasanEnableDeferredFreeThreadFunc syzyasan_enable_deferred_free =
+ reinterpret_cast<SyzyasanEnableDeferredFreeThreadFunc>(
+ ::GetProcAddress(syzyasan_handle,
+ "asan_EnableDeferredFreeThread"));
+ if (syzyasan_enable_deferred_free) {
+ syzyasan_enable_deferred_free();
+ success = true;
+ }
+ }
+ UMA_HISTOGRAM_BOOLEAN("Syzyasan.DeferredFreeWasEnabled", success);
+ }
+#endif
+
// Start the tab manager here so that we give the most amount of time for the
// other services to start up before we start adjusting the oom priority.
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS)
« no previous file with comments | « no previous file | chrome/common/chrome_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698