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

Unified Diff: base/process_util_linux.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/leak_annotations.h ('k') | base/process_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_util_linux.cc
diff --git a/base/process_util_linux.cc b/base/process_util_linux.cc
index 25f1c2708e65a2c9b3065cbb22f347eea4fee95a..12ffe302a1980d37e940bb317dce9f189c6633bb 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);
@@ -584,7 +580,7 @@ DIE_ON_OOM_2(memalign, size_t)
DIE_ON_OOM_3INT(posix_memalign)
-#endif // defined(LINUX_USE_TCMALLOC)
+#endif // !defined(LINUX_USE_TCMALLOC)
} // extern C
@@ -593,10 +589,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
« no previous file with comments | « base/leak_annotations.h ('k') | base/process_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698