diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-25 00:17:53 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-25 00:17:53 +0000 |
commit | 3c4e3015463fd407ccd932e5da17e3c4bc8e3c5c (patch) | |
tree | 0d9eb8dc82e0514d1b77943bb452b75396f18dea /base/process_util_unittest.cc | |
parent | f820596a817c435611567e5131709162bfb6cfad (diff) | |
download | chromium_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_unittest.cc')
-rw-r--r-- | base/process_util_unittest.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc index 3f53f2a..fe28502 100644 --- a/base/process_util_unittest.cc +++ b/base/process_util_unittest.cc @@ -365,8 +365,14 @@ TEST_F(ProcessUtilTest, ParseProcStatCPU) { #endif // defined(OS_POSIX) -#if defined(OS_LINUX) // TODO(vandebo) make this work on Windows and Mac too. +#if defined(OS_LINUX) + +#if defined(LINUX_USE_TCMALLOC) +extern "C" { +int tc_set_new_mode(int mode); +} +#endif // defined(LINUX_USE_TCMALLOC) class OutOfMemoryTest : public testing::Test { public: @@ -381,6 +387,13 @@ class OutOfMemoryTest : public testing::Test { // Must call EnableTerminationOnOutOfMemory() because that is called from // chrome's main function and therefore hasn't been called yet. EnableTerminationOnOutOfMemory(); +#if defined(LINUX_USE_TCMALLOC) + tc_set_new_mode(1); + } + + virtual void TearDown() { + tc_set_new_mode(0); +#endif // defined(LINUX_USE_TCMALLOC) } void* value_; |