summaryrefslogtreecommitdiffstats
path: root/third_party/tcmalloc/chromium/src/malloc_extension.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/tcmalloc/chromium/src/malloc_extension.cc')
-rw-r--r--third_party/tcmalloc/chromium/src/malloc_extension.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/third_party/tcmalloc/chromium/src/malloc_extension.cc b/third_party/tcmalloc/chromium/src/malloc_extension.cc
index 4ce262f..c2f8b54 100644
--- a/third_party/tcmalloc/chromium/src/malloc_extension.cc
+++ b/third_party/tcmalloc/chromium/src/malloc_extension.cc
@@ -187,7 +187,10 @@ MallocExtension* MallocExtension::instance() {
void MallocExtension::Register(MallocExtension* implementation) {
perftools_pthread_once(&module_init, InitModule);
// When running under valgrind, our custom malloc is replaced with
- // valgrind's one and malloc extensions will not work.
+ // valgrind's one and malloc extensions will not work. (Note:
+ // callers should be responsible for checking that they are the
+ // malloc that is really being run, before calling Register. This
+ // is just here as an extra sanity check.)
if (!RunningOnValgrind()) {
current_instance = implementation;
}