summaryrefslogtreecommitdiffstats
path: root/base/process_util_linux.cc
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 /base/process_util_linux.cc
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 'base/process_util_linux.cc')
-rw-r--r--base/process_util_linux.cc12
1 files changed, 2 insertions, 10 deletions
diff --git a/base/process_util_linux.cc b/base/process_util_linux.cc
index 98508be..bd6bcf3 100644
--- a/base/process_util_linux.cc
+++ b/base/process_util_linux.cc
@@ -514,11 +514,7 @@ void OnNoMemory() {
extern "C" {
-#if defined(LINUX_USE_TCMALLOC)
-
-int tc_set_new_mode(int mode);
-
-#else // defined(LINUX_USE_TCMALLOC)
+#if !defined(LINUX_USE_TCMALLOC)
typedef void* (*malloc_type)(size_t size);
typedef void* (*valloc_type)(size_t size);
@@ -603,7 +599,7 @@ int posix_memalign(void** ptr, size_t alignment, size_t size) {
return ret;
}
-#endif // defined(LINUX_USE_TCMALLOC)
+#endif // !defined(LINUX_USE_TCMALLOC)
} // extern C
@@ -612,10 +608,6 @@ void EnableTerminationOnOutOfMemory() {
std::set_new_handler(&OnNoMemory);
// If we're using glibc's allocator, the above functions will override
// malloc and friends and make them die on out of memory.
-#if defined(LINUX_USE_TCMALLOC)
- // For tcmalloc, we just need to tell it to behave like new.
- tc_set_new_mode(1);
-#endif
}
} // namespace base