summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/allocator/allocator_shim.cc2
-rw-r--r--chrome/browser/browser_main.cc14
2 files changed, 15 insertions, 1 deletions
diff --git a/base/allocator/allocator_shim.cc b/base/allocator/allocator_shim.cc
index 3935737..685f700 100644
--- a/base/allocator/allocator_shim.cc
+++ b/base/allocator/allocator_shim.cc
@@ -35,7 +35,7 @@ typedef enum {
} Allocator;
// This is the default allocator.
-static Allocator allocator = TCMALLOC;
+static Allocator allocator = WINDEFAULT;
// We include tcmalloc and the win_allocator to get as much inlining as
// possible.
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index a7a565c..b008ecf 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -1139,6 +1139,20 @@ int BrowserMain(const MainFunctionParams& parameters) {
const CommandLine& parsed_command_line = parameters.command_line_;
base::mac::ScopedNSAutoreleasePool* pool = parameters.autorelease_pool_;
+
+#if defined(OS_WIN)
+ // TODO(jar): This really shouldn't be here... but it is a temporary test and
+ // I'll be deleting it ASAP.
+ const char* env_var_name = "CHROME_ALLOCATOR";
+ size_t space_needed = 0;
+ getenv_s(&space_needed, NULL, 0, env_var_name);
+ if (!space_needed) { // Variable not found.
+ // Force render to use TCMALLOC, ignoring default.
+ int ret_val = _putenv_s(env_var_name, "TCMALLOC");
+ CHECK_EQ(0, ret_val);
+ }
+#endif // OS_WIN
+
FilePath user_data_dir;
#if defined(OS_WIN)
PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);