summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2019-02-08 17:22:52 -0500
committerHenrik Edin <henrik.edin@mongodb.com>2019-03-12 15:21:32 -0400
commitafe082642124dbda2367cb51c3d748873df9bf7b (patch)
tree0a795f2b3fc17e468c4b923357e6e803e85d818c /SConstruct
parentc7e6cd6803e584a6951469e74af93ec3a7a47148 (diff)
downloadmongo-afe082642124dbda2367cb51c3d748873df9bf7b.tar.gz
SERVER-36243 Use sized deallocation.
Added mongoFree to be used when allocating memory with mongoMalloc. It has an overload taking size utilizing tc_free_sized if built with tcmalloc.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct5
1 files changed, 4 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct
index 057cf32fa64..830b0116f1a 100644
--- a/SConstruct
+++ b/SConstruct
@@ -2392,12 +2392,15 @@ def doConfigure(myenv):
if myenv.ToolchainIs('msvc'):
myenv.AppendUnique(CCFLAGS=['/Zc:__cplusplus', '/permissive-'])
if get_option('cxx-std') == "17":
- myenv.AppendUnique(CCFLAGS=['/std:c++17'])
+ myenv.AppendUnique(CCFLAGS=['/std:c++17', '/Zc:sizedDealloc'])
else:
if get_option('cxx-std') == "17":
if not AddToCXXFLAGSIfSupported(myenv, '-std=c++17'):
myenv.ConfError('Compiler does not honor -std=c++17')
+ if not AddToCXXFLAGSIfSupported(myenv, '-fsized-deallocation'):
+ myenv.ConfError('Compiler does not honor -fsized-deallocation')
+
if not AddToCFLAGSIfSupported(myenv, '-std=c11'):
myenv.ConfError("C++14/17 mode selected for C++ files, but can't enable C11 for C files")