diff options
Diffstat (limited to 'base/allocator')
-rw-r--r-- | base/allocator/BUILD.gn | 6 | ||||
-rw-r--r-- | base/allocator/allocator.gyp | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/base/allocator/BUILD.gn b/base/allocator/BUILD.gn index 5270a91..0049800 100644 --- a/base/allocator/BUILD.gn +++ b/base/allocator/BUILD.gn @@ -47,13 +47,17 @@ config("allocator_shim_define") { } config("tcmalloc_flags") { + defines = [] if (enable_debugallocation) { - defines = [ + defines += [ # Use debugallocation for Debug builds to catch problems early # and cleanly, http://crbug.com/30715 . "TCMALLOC_FOR_DEBUGALLOCATION", ] } + if (use_experimental_allocator_shim) { + defines += [ "TCMALLOC_DONT_REPLACE_SYSTEM_ALLOC" ] + } if (is_clang) { cflags = [ # tcmalloc initializes some fields in the wrong order. diff --git a/base/allocator/allocator.gyp b/base/allocator/allocator.gyp index 37459e0..b5d751e 100644 --- a/base/allocator/allocator.gyp +++ b/base/allocator/allocator.gyp @@ -20,6 +20,7 @@ # e.g. for profiling (it's more rare to profile Debug builds, # but people sometimes need to do that). 'disable_debugallocation%': 0, + 'use_experimental_allocator_shim%': 0, }, 'targets': [ # The only targets that should depend on allocator are 'base' and @@ -340,6 +341,11 @@ '<(tcmalloc_dir)/src/profiler.cc', ], }], + ['use_experimental_allocator_shim==1', { + 'defines': [ + 'TCMALLOC_DONT_REPLACE_SYSTEM_ALLOC', + ], + }] ], 'configurations': { 'Debug_Base': { |