OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/buildflag_header.gni") | 5 import("//build/buildflag_header.gni") |
6 import("//build/config/allocator.gni") | 6 import("//build/config/allocator.gni") |
7 import("//build/config/compiler/compiler.gni") | 7 import("//build/config/compiler/compiler.gni") |
8 | 8 |
9 declare_args() { | 9 declare_args() { |
10 # Provide a way to force disable debugallocation in Debug builds, | 10 # Provide a way to force disable debugallocation in Debug builds, |
11 # e.g. for profiling (it's more rare to profile Debug builds, | 11 # e.g. for profiling (it's more rare to profile Debug builds, |
12 # but people sometimes need to do that). | 12 # but people sometimes need to do that). |
13 enable_debugallocation = is_debug | 13 enable_debugallocation = is_debug |
14 } | 14 } |
15 | 15 |
16 # Allocator shim is only enabled for Release static builds. | 16 # The Windows-only allocator shim is only enabled for Release static builds, and |
17 win_use_allocator_shim = is_win && !is_component_build && !is_debug | 17 # is mutually exclusive with the generalized shim. |
| 18 win_use_allocator_shim = is_win && !is_component_build && !is_debug && |
| 19 !use_experimental_allocator_shim |
18 | 20 |
19 # This "allocator" meta-target will forward to the default allocator according | 21 # This "allocator" meta-target will forward to the default allocator according |
20 # to the build settings. | 22 # to the build settings. |
21 group("allocator") { | 23 group("allocator") { |
22 public_deps = [] | 24 public_deps = [] |
23 deps = [] | 25 deps = [] |
24 | 26 |
25 if (use_allocator == "tcmalloc") { | 27 if (use_allocator == "tcmalloc") { |
26 deps += [ ":tcmalloc" ] | 28 deps += [ ":tcmalloc" ] |
27 } | 29 } |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 # Linux/CrOS/Android. http://crbug.com/550886 . | 306 # Linux/CrOS/Android. http://crbug.com/550886 . |
305 configs += [ "//base:base_implementation" ] # for BASE_EXPORT | 307 configs += [ "//base:base_implementation" ] # for BASE_EXPORT |
306 visibility = [ "//base:base" ] | 308 visibility = [ "//base:base" ] |
307 sources = [ | 309 sources = [ |
308 "allocator_shim.cc", | 310 "allocator_shim.cc", |
309 "allocator_shim.h", | 311 "allocator_shim.h", |
310 "allocator_shim_internals.h", | 312 "allocator_shim_internals.h", |
311 "allocator_shim_override_cpp_symbols.h", | 313 "allocator_shim_override_cpp_symbols.h", |
312 "allocator_shim_override_libc_symbols.h", | 314 "allocator_shim_override_libc_symbols.h", |
313 ] | 315 ] |
314 if (is_linux && use_allocator == "tcmalloc") { | 316 if (is_win) { |
| 317 sources += [ |
| 318 "allocator_shim_default_dispatch_to_winheap.cc", |
| 319 "allocator_shim_override_ucrt_symbols_win.h", |
| 320 "winheap_stubs_win.cc", |
| 321 "winheap_stubs_win.h", |
| 322 ] |
| 323 } else if (is_linux && use_allocator == "tcmalloc") { |
315 sources += [ | 324 sources += [ |
316 "allocator_shim_default_dispatch_to_tcmalloc.cc", | 325 "allocator_shim_default_dispatch_to_tcmalloc.cc", |
317 "allocator_shim_override_glibc_weak_symbols.h", | 326 "allocator_shim_override_glibc_weak_symbols.h", |
318 ] | 327 ] |
319 deps = [ | 328 deps = [ |
320 ":tcmalloc", | 329 ":tcmalloc", |
321 ] | 330 ] |
322 } else if (is_linux && use_allocator == "none") { | 331 } else if (is_linux && use_allocator == "none") { |
323 sources += [ "allocator_shim_default_dispatch_to_glibc.cc" ] | 332 sources += [ "allocator_shim_default_dispatch_to_glibc.cc" ] |
324 } else if (is_android && use_allocator == "none") { | 333 } else if (is_android && use_allocator == "none") { |
325 sources += [ | 334 sources += [ |
326 "allocator_shim_default_dispatch_to_linker_wrapped_symbols.cc", | 335 "allocator_shim_default_dispatch_to_linker_wrapped_symbols.cc", |
327 "allocator_shim_override_linker_wrapped_symbols.h", | 336 "allocator_shim_override_linker_wrapped_symbols.h", |
328 ] | 337 ] |
329 all_dependent_configs = [ ":wrap_malloc_symbols" ] | 338 all_dependent_configs = [ ":wrap_malloc_symbols" ] |
330 } | 339 } |
331 } | 340 } |
332 } | 341 } |
OLD | NEW |