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

Unified Diff: third_party/tcmalloc/chromium/src/tcmalloc.cc

Issue 1577883002: Add run-time CHECK to smoke-test allocator overrides (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: AAAAArgh, inconsistent trailing dot in README.chromium Created 4 years, 11 months 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 | « third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tcmalloc/chromium/src/tcmalloc.cc
diff --git a/third_party/tcmalloc/chromium/src/tcmalloc.cc b/third_party/tcmalloc/chromium/src/tcmalloc.cc
index 4709411718bc9eba3e96af3d4b4cc6ac1233284b..3077b75972645cf82958edacb65180bbea1db384 100644
--- a/third_party/tcmalloc/chromium/src/tcmalloc.cc
+++ b/third_party/tcmalloc/chromium/src/tcmalloc.cc
@@ -1390,7 +1390,13 @@ inline void do_malloc_stats() {
}
inline int do_mallopt(int cmd, int value) {
- return 1; // Indicates error
+ if (cmd == TC_MALLOPT_IS_OVERRIDDEN_BY_TCMALLOC)
+ return TC_MALLOPT_IS_OVERRIDDEN_BY_TCMALLOC;
+
+ // 1 is the success return value according to man mallopt(). However (see the
+ // BUGS section in the manpage), most implementations return always 1.
+ // This code is just complying with that (buggy) expectation.
+ return 1;
}
#ifdef HAVE_STRUCT_MALLINFO
« no previous file with comments | « third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698