Index: chrome/app/chrome_exe_main_gtk.cc |
diff --git a/chrome/app/chrome_exe_main_gtk.cc b/chrome/app/chrome_exe_main_gtk.cc |
index 9c84f16b003a0d9412284b595b95965b49d8935b..cd2edcb93cc6133092b503fadd0d22f8d9bf27aa 100644 |
--- a/chrome/app/chrome_exe_main_gtk.cc |
+++ b/chrome/app/chrome_exe_main_gtk.cc |
@@ -16,12 +16,30 @@ |
extern "C" { |
int ChromeMain(int argc, const char** argv); |
+ |
+#if defined(LINUX_USE_TCMALLOC) |
+ |
+int tc_set_new_mode(int mode); |
+ |
+#endif // defined(LINUX_USE_TCMALLOC) |
+ |
} |
int main(int argc, const char** argv) { |
base::EnableTerminationOnHeapCorruption(); |
base::EnableTerminationOnOutOfMemory(); |
+ // NOTE(willchan): One might ask why this call is done here rather than in |
+ // process_util_linux.cc with the definition of |
+ // EnableTerminationOnOutOfMemory(). That's because base shouldn't have a |
+ // dependency on TCMalloc. Really, we ought to have our allocator shim code |
+ // implement this EnableTerminationOnOutOfMemory() function. Whateverz. This |
+ // works for now. |
+#if defined(LINUX_USE_TCMALLOC) |
+ // For tcmalloc, we need to tell it to behave like new. |
+ tc_set_new_mode(1); |
+#endif |
+ |
// The exit manager is in charge of calling the dtors of singletons. |
// Win has one here, but we assert with multiples from BrowserMain() if we |
// keep it. |