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/config/allocator.gni") | 5 import("//build/config/allocator.gni") |
6 import("//build/config/compiler/compiler.gni") | 6 import("//build/config/compiler/compiler.gni") |
7 | 7 |
8 if (is_win) { | 8 if (is_win) { |
9 import("//build/config/win/visual_studio_version.gni") | 9 import("//build/config/win/visual_studio_version.gni") |
10 } | 10 } |
(...skipping 29 matching lines...) Expand all Loading... |
40 # TODO(brettw) this is only used in one place and is kind of mess, because it | 40 # TODO(brettw) this is only used in one place and is kind of mess, because it |
41 # assumes that the library using it will eventually be linked with | 41 # assumes that the library using it will eventually be linked with |
42 # //base/allocator in the default way. Clean this up and delete this. | 42 # //base/allocator in the default way. Clean this up and delete this. |
43 config("allocator_shim_define") { | 43 config("allocator_shim_define") { |
44 if (is_win && !is_component_build && visual_studio_version != "2015") { | 44 if (is_win && !is_component_build && visual_studio_version != "2015") { |
45 defines = [ "ALLOCATOR_SHIM" ] | 45 defines = [ "ALLOCATOR_SHIM" ] |
46 } | 46 } |
47 } | 47 } |
48 | 48 |
49 config("tcmalloc_flags") { | 49 config("tcmalloc_flags") { |
| 50 defines = [] |
50 if (enable_debugallocation) { | 51 if (enable_debugallocation) { |
51 defines = [ | 52 defines += [ |
52 # Use debugallocation for Debug builds to catch problems early | 53 # Use debugallocation for Debug builds to catch problems early |
53 # and cleanly, http://crbug.com/30715 . | 54 # and cleanly, http://crbug.com/30715 . |
54 "TCMALLOC_FOR_DEBUGALLOCATION", | 55 "TCMALLOC_FOR_DEBUGALLOCATION", |
55 ] | 56 ] |
56 } | 57 } |
| 58 if (use_experimental_allocator_shim) { |
| 59 defines += [ "TCMALLOC_DONT_REPLACE_SYSTEM_ALLOC" ] |
| 60 } |
57 if (is_clang) { | 61 if (is_clang) { |
58 cflags = [ | 62 cflags = [ |
59 # tcmalloc initializes some fields in the wrong order. | 63 # tcmalloc initializes some fields in the wrong order. |
60 "-Wno-reorder", | 64 "-Wno-reorder", |
61 | 65 |
62 # tcmalloc contains some unused local template specializations. | 66 # tcmalloc contains some unused local template specializations. |
63 "-Wno-unused-function", | 67 "-Wno-unused-function", |
64 | 68 |
65 # tcmalloc uses COMPILE_ASSERT without static_assert but with | 69 # tcmalloc uses COMPILE_ASSERT without static_assert but with |
66 # typedefs. | 70 # typedefs. |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 # Make sure the allocation library is optimized as much as possible when | 287 # Make sure the allocation library is optimized as much as possible when |
284 # we"re in release mode. | 288 # we"re in release mode. |
285 if (!is_debug) { | 289 if (!is_debug) { |
286 configs -= [ "//build/config/compiler:default_optimization" ] | 290 configs -= [ "//build/config/compiler:default_optimization" ] |
287 configs += [ "//build/config/compiler:optimize_max" ] | 291 configs += [ "//build/config/compiler:optimize_max" ] |
288 } | 292 } |
289 | 293 |
290 deps += [ "//base/third_party/dynamic_annotations" ] | 294 deps += [ "//base/third_party/dynamic_annotations" ] |
291 } | 295 } |
292 } # use_allocator == "tcmalloc" | 296 } # use_allocator == "tcmalloc" |
OLD | NEW |