Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1216)

Unified Diff: base/process_util_unittest.cc

Issue 399081: Enable TCMalloc on Linux by default. (Closed)
Patch Set: Oops, remove unintended change. Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/process_util_linux.cc ('k') | build/common.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_util_unittest.cc
diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc
index 4169dc6b1ec26a5dc9cfcf95aff8744adfd8a62e..15980952b36fed401cbbc5aa3884eb6cd55ee82e 100644
--- a/base/process_util_unittest.cc
+++ b/base/process_util_unittest.cc
@@ -364,8 +364,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:
@@ -380,6 +386,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_;
« no previous file with comments | « base/process_util_linux.cc ('k') | build/common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698