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

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: 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 0f156e6f0b470b1b38ec234a100ea8323139c2ff..ee481a14a7970c3165036e99f9cf40d37edaf2b4 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -90,6 +90,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"
@@ -1182,6 +1183,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 SyzyasanModuleHandle = ::GetModuleHandle(L"syzyasan_rtl.dll");
chrisha 2016/03/17 18:35:28 euhh... snake_style variable names instead of Came
Georges Khalil 2016/03/17 19:34:39 Oops, I was looking at Windows code for too long :
+ bool success = false;
+ if (SyzyasanModuleHandle) {
+ SyzyasanEnableDeferredFreeThreadFunc EnableDeferredFreeThread =
chrisha 2016/03/17 18:35:28 ditto
Georges Khalil 2016/03/17 19:34:39 Done.
+ reinterpret_cast<SyzyasanEnableDeferredFreeThreadFunc>(
+ ::GetProcAddress(SyzyasanModuleHandle,
+ "asan_EnableDeferredFreeThread"));
+ if (EnableDeferredFreeThread) {
+ EnableDeferredFreeThread();
+ 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