summaryrefslogtreecommitdiffstats
path: root/base/allocator
diff options
context:
space:
mode:
authorprimiano <primiano@chromium.org>2016-02-09 12:22:16 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-09 20:23:07 +0000
commit3217078aa86523fb341e0cf2b0c49d55434b534a (patch)
tree9329d7272d476804a1a028e65c14f478f747a06b /base/allocator
parentfc37513b69d48a1b076febe2952d74fe9596cecd (diff)
downloadchromium_src-3217078aa86523fb341e0cf2b0c49d55434b534a.zip
chromium_src-3217078aa86523fb341e0cf2b0c49d55434b534a.tar.gz
chromium_src-3217078aa86523fb341e0cf2b0c49d55434b534a.tar.bz2
allocator: add use_experimental_allocator_shim build flag
This CL introduces a new GYP/GN build flag use_experimental_allocator_shim (default: false). After this CL, the only side-effect of that flag is that tcmalloc does not override anymore the libc symbols (malloc, new etc.). This is in preparation of a unified shim layer, which will come separately in upcoming CLs, which will take care of overriding those symbols in Chrome. Design doc: http://bit.ly/allocator-shim BUG=550886 Review URL: https://codereview.chromium.org/1678893002 Cr-Commit-Position: refs/heads/master@{#374449}
Diffstat (limited to 'base/allocator')
-rw-r--r--base/allocator/BUILD.gn6
-rw-r--r--base/allocator/allocator.gyp6
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': {