diff options
author | Andrew Morrow <acm@10gen.com> | 2013-10-03 09:59:15 -0400 |
---|---|---|
committer | Andrew Morrow <acm@10gen.com> | 2013-10-03 14:32:55 -0400 |
commit | 09778704b9d7f8fb8b0d1ab170e2cf502387b78b (patch) | |
tree | 9fa05ab391cdc4eb5b8d05d0d3ba6bfcd4c6aa00 /src/third_party | |
parent | 88848ea94aaedf17f9b7f46631231d95b9a46038 (diff) | |
download | mongo-09778704b9d7f8fb8b0d1ab170e2cf502387b78b.tar.gz |
SERVER-11010 For non-debug builds, build gperftools with NDEBUG to prefer the sbrk allocator
Diffstat (limited to 'src/third_party')
-rw-r--r-- | src/third_party/gperftools-2.0/SConscript | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/third_party/gperftools-2.0/SConscript b/src/third_party/gperftools-2.0/SConscript index 084c10b4953..dcf596a9d09 100644 --- a/src/third_party/gperftools-2.0/SConscript +++ b/src/third_party/gperftools-2.0/SConscript @@ -2,6 +2,7 @@ Import("env") Import("has_option") +Import("debugBuild") files = [ 'src/base/dynamic_annotations.c', @@ -56,7 +57,16 @@ conf.CheckMallocHookVolatile() env = conf.Finish() -env.Append( CPPDEFINES=["NO_TCMALLOC_SAMPLES","NO_TCMALLOC_SAMPLES","NO_HEAP_CHECK"] ) +env.Append( CPPDEFINES=[ "NO_TCMALLOC_SAMPLES", "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. +if not debugBuild: + env.AppendUnique( CPPDEFINES=["NDEBUG"] ) + env.Prepend( CPPPATH=["src/"] ) my_SYSLIBDEPS = [] |