summaryrefslogtreecommitdiffstats
path: root/chrome/app
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-25 00:17:53 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-25 00:17:53 +0000
commit3c4e3015463fd407ccd932e5da17e3c4bc8e3c5c (patch)
tree0d9eb8dc82e0514d1b77943bb452b75396f18dea /chrome/app
parentf820596a817c435611567e5131709162bfb6cfad (diff)
downloadchromium_src-3c4e3015463fd407ccd932e5da17e3c4bc8e3c5c.zip
chromium_src-3c4e3015463fd407ccd932e5da17e3c4bc8e3c5c.tar.gz
chromium_src-3c4e3015463fd407ccd932e5da17e3c4bc8e3c5c.tar.bz2
Enable TCMalloc on Linux by default.
This change also reworks the tcmalloc dependency to be added only to chrome and test_shell, instead of base. This is necessary since otherwise tcmalloc will be double initialized (by both the main executable and dlopen'd shared objects like the npapitestplugin.so). Add valgrind suppressions. This are invalid reads on static initialization in the VDSOSupport module. I haven't investigated it yet, but I suspect they're benign. BUG=http://crbug.com/28149, http://crbug.com/28385 Review URL: http://codereview.chromium.org/399081 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33010 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app')
-rw-r--r--chrome/app/chrome_exe_main_gtk.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/app/chrome_exe_main_gtk.cc b/chrome/app/chrome_exe_main_gtk.cc
index 9c84f16..cd2edcb 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.