summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/third_party/gperftools-2.5/SConscript10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/third_party/gperftools-2.5/SConscript b/src/third_party/gperftools-2.5/SConscript
index f18a43a8ad9..e2696c7d545 100644
--- a/src/third_party/gperftools-2.5/SConscript
+++ b/src/third_party/gperftools-2.5/SConscript
@@ -84,15 +84,21 @@ env = conf.Finish()
env.Append(CPPPATH=["build_" + env["TARGET_OS"] + "_" + env["TARGET_ARCH"]])
-env.Append( CPPDEFINES=[ "NO_TCMALLOC_SAMPLES", "NO_HEAP_CHECK"] )
+env.Append(
+ CPPDEFINES=["NO_HEAP_CHECK"],
+)
# The build system doesn't define NDEBUG globally for historical reasons, however, TCMalloc
# expects that NDEBUG is used to select between preferring the mmap or the sbrk allocator. For
# non-debug builds, we want to prefer the sbrk allocator since this is TCMallocs preferred
# production deployment configuration. See the use of NDEBUG and kDebugMode in
# src/system-alloc.cc for more details.
+#
+# Additionally, for debug builds we do want to capture stacks during (de)allocations, but we don't
+# want to pay that cost for release builds. For non-debug builds we use NO_TCMALLOC_SAMPLES to
+# disable the stack trace collection.
if not debugBuild:
- env.Append( CPPDEFINES=["NDEBUG"] )
+ env.Append( CPPDEFINES=["NDEBUG", "NO_TCMALLOC_SAMPLES"] )
env.Prepend( CPPPATH=["src/"] )