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/config/allocator.gni") | 6 import("//build/config/allocator.gni") |
6 import("//build/config/compiler/compiler.gni") | 7 import("//build/config/compiler/compiler.gni") |
7 | 8 |
8 if (is_win) { | 9 if (is_win) { |
9 import("//build/config/win/visual_studio_version.gni") | 10 import("//build/config/win/visual_studio_version.gni") |
10 } | 11 } |
11 | 12 |
12 declare_args() { | 13 declare_args() { |
13 # Provide a way to force disable debugallocation in Debug builds, | 14 # Provide a way to force disable debugallocation in Debug builds, |
14 # e.g. for profiling (it's more rare to profile Debug builds, | 15 # e.g. for profiling (it's more rare to profile Debug builds, |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 # Make sure the allocation library is optimized as much as possible when | 288 # Make sure the allocation library is optimized as much as possible when |
288 # we"re in release mode. | 289 # we"re in release mode. |
289 if (!is_debug) { | 290 if (!is_debug) { |
290 configs -= [ "//build/config/compiler:default_optimization" ] | 291 configs -= [ "//build/config/compiler:default_optimization" ] |
291 configs += [ "//build/config/compiler:optimize_max" ] | 292 configs += [ "//build/config/compiler:optimize_max" ] |
292 } | 293 } |
293 | 294 |
294 deps += [ "//base/third_party/dynamic_annotations" ] | 295 deps += [ "//base/third_party/dynamic_annotations" ] |
295 } | 296 } |
296 } # use_allocator == "tcmalloc" | 297 } # use_allocator == "tcmalloc" |
| 298 |
| 299 buildflag_header("features") { |
| 300 header = "features.h" |
| 301 flags = [ "USE_EXPERIMENTAL_ALLOCATOR_SHIM=$use_experimental_allocator_shim" ] |
| 302 } |
| 303 |
| 304 if (use_experimental_allocator_shim) { |
| 305 source_set("unified_allocator_shim") { |
| 306 # TODO(primiano): support other platforms, currently this works only on |
| 307 # Linux/CrOS. http://crbug.com/550886 . |
| 308 configs += [ "//base:base_implementation" ] # for BASE_EXPORT |
| 309 visibility = [ "//base:base" ] |
| 310 sources = [ |
| 311 "allocator_shim.cc", |
| 312 "allocator_shim.h", |
| 313 "allocator_shim_internals.h", |
| 314 "allocator_shim_override_cpp_symbols.h", |
| 315 "allocator_shim_override_libc_symbols.h", |
| 316 ] |
| 317 if (is_linux && use_allocator == "tcmalloc") { |
| 318 sources += [ |
| 319 "allocator_shim_default_dispatch_to_tcmalloc.cc", |
| 320 "allocator_shim_override_glibc_weak_symbols.h", |
| 321 ] |
| 322 deps = [ |
| 323 ":tcmalloc", |
| 324 ] |
| 325 } else if (is_linux && use_allocator == "none") { |
| 326 sources += [ "allocator_shim_default_dispatch_to_glibc.cc" ] |
| 327 } |
| 328 } |
| 329 } |
OLD | NEW |