summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_main.cc
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-07 23:27:05 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-07 23:27:05 +0000
commit6452f1c0627a15a097472da9ea848408ebe080a8 (patch)
tree19852185abec0c3d5da551944756efc6e41d2d00 /chrome/browser/browser_main.cc
parent84f3d2da5271db6b299afc310c2a479b5d244822 (diff)
downloadchromium_src-6452f1c0627a15a097472da9ea848408ebe080a8.zip
chromium_src-6452f1c0627a15a097472da9ea848408ebe080a8.tar.gz
chromium_src-6452f1c0627a15a097472da9ea848408ebe080a8.tar.bz2
Support mixed allocation in browser vs subprocesses
Continue to support selection of a browser allocator selection via the environment variable CHROME_ALLOCATOR, and also add CHROME_ALLOCATOR_2 that can select the allocator to use in subprocesses, such as a renderer. Temporarilly set the browser default to the default windows heap allocator, and the subprocess allocator to TCMalloc to help detect memory corruption in a cannary for a few days. Add minor cleanup (removing reserved word "override" etc.). r=mbelshe bug=74901 Review URL: http://codereview.chromium.org/6623059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77207 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_main.cc')
-rw-r--r--chrome/browser/browser_main.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index a7a565c..745be4c 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -8,6 +8,7 @@
#include <string>
#include <vector>
+#include "base/allocator/allocator_shim.h"
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/debug/trace_event.h"
@@ -1139,6 +1140,11 @@ int BrowserMain(const MainFunctionParams& parameters) {
const CommandLine& parsed_command_line = parameters.command_line_;
base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_;
+#if defined(OS_WIN)
+ // Make this call before going multithreaded, or spawning any subprocesses.
+ base::allocator::SetupSubprocessAllocator();
+#endif // OS_WIN
+
FilePath user_data_dir;
#if defined(OS_WIN)
PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);