| 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 | 6 |
| 7 declare_args() { | 7 declare_args() { |
| 8 # Provide a way to force disable debugallocation in Debug builds, | 8 # Provide a way to force disable debugallocation in Debug builds, |
| 9 # e.g. for profiling (it's more rare to profile Debug builds, | 9 # e.g. for profiling (it's more rare to profile Debug builds, |
| 10 # but people sometimes need to do that). | 10 # but people sometimes need to do that). |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 "$tcmalloc_dir/src/system-alloc.cc", | 195 "$tcmalloc_dir/src/system-alloc.cc", |
| 196 "$tcmalloc_dir/src/system-alloc.h", | 196 "$tcmalloc_dir/src/system-alloc.h", |
| 197 | 197 |
| 198 # #included by debugallocation_shim.cc | 198 # #included by debugallocation_shim.cc |
| 199 #"$tcmalloc_dir/src/tcmalloc.cc", | 199 #"$tcmalloc_dir/src/tcmalloc.cc", |
| 200 "$tcmalloc_dir/src/thread_cache.cc", | 200 "$tcmalloc_dir/src/thread_cache.cc", |
| 201 "$tcmalloc_dir/src/thread_cache.h", | 201 "$tcmalloc_dir/src/thread_cache.h", |
| 202 "$tcmalloc_dir/src/windows/port.cc", | 202 "$tcmalloc_dir/src/windows/port.cc", |
| 203 "$tcmalloc_dir/src/windows/port.h", | 203 "$tcmalloc_dir/src/windows/port.h", |
| 204 "debugallocation_shim.cc", | 204 "debugallocation_shim.cc", |
| 205 "tcmalloc_extension.cc", |
| 205 | 206 |
| 206 # These are both #included by allocator_shim for maximal linking. | 207 # These are both #included by allocator_shim for maximal linking. |
| 207 #"generic_allocators.cc", | 208 #"generic_allocators.cc", |
| 208 #"win_allocator.cc", | 209 #"win_allocator.cc", |
| 209 ] | 210 ] |
| 210 | 211 |
| 211 # Disable the heap checker in tcmalloc. | 212 # Disable the heap checker in tcmalloc. |
| 212 defines = [ "NO_HEAP_CHECK" ] | 213 defines = [ "NO_HEAP_CHECK" ] |
| 213 | 214 |
| 214 include_dirs = [ | 215 include_dirs = [ |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 281 |
| 281 ldflags = [ | 282 ldflags = [ |
| 282 # Don't let linker rip this symbol out, otherwise the heap&cpu | 283 # Don't let linker rip this symbol out, otherwise the heap&cpu |
| 283 # profilers will not initialize properly on startup. | 284 # profilers will not initialize properly on startup. |
| 284 "-Wl,-uIsHeapProfilerRunning,-uProfilerStart", | 285 "-Wl,-uIsHeapProfilerRunning,-uProfilerStart", |
| 285 | 286 |
| 286 # Do the same for heap leak checker. | 287 # Do the same for heap leak checker. |
| 287 "-Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_MMapPKvS0_j
iiix,-u_Z22InitialMallocHook_SbrkPKvi", | 288 "-Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_MMapPKvS0_j
iiix,-u_Z22InitialMallocHook_SbrkPKvi", |
| 288 "-Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_MMapPKvS0_m
iiil,-u_Z22InitialMallocHook_SbrkPKvl", | 289 "-Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_MMapPKvS0_m
iiil,-u_Z22InitialMallocHook_SbrkPKvl", |
| 289 "-Wl,-u_ZN15HeapLeakChecker12IgnoreObjectEPKv,-u_ZN15HeapLeakChecker14Un
IgnoreObjectEPKv", | 290 "-Wl,-u_ZN15HeapLeakChecker12IgnoreObjectEPKv,-u_ZN15HeapLeakChecker14Un
IgnoreObjectEPKv", |
| 291 |
| 292 # For InitializeAllocatorWeak function implementation for tcmalloc. |
| 293 "-Wl,-u_ZN4base9allocator23InitializeAllocatorWeakEv", |
| 290 ] | 294 ] |
| 291 } | 295 } |
| 292 | 296 |
| 293 # Make sure the allocation library is optimized as much as possible when | 297 # Make sure the allocation library is optimized as much as possible when |
| 294 # we"re in release mode. | 298 # we"re in release mode. |
| 295 if (!is_debug) { | 299 if (!is_debug) { |
| 296 configs -= [ "//build/config/compiler:default_optimization" ] | 300 configs -= [ "//build/config/compiler:default_optimization" ] |
| 297 configs += [ "//build/config/compiler:optimize_max" ] | 301 configs += [ "//build/config/compiler:optimize_max" ] |
| 298 } | 302 } |
| 299 | 303 |
| 300 deps += [ "//base/third_party/dynamic_annotations" ] | 304 deps += [ "//base/third_party/dynamic_annotations" ] |
| 301 | 305 |
| 302 if (is_win) { | 306 if (is_win) { |
| 303 ldflags = [ "/ignore:4006:4221" ] | 307 ldflags = [ "/ignore:4006:4221" ] |
| 304 } | 308 } |
| 305 } | 309 } |
| 306 } # !is_android | 310 } # !is_android |
| 307 | 311 |
| 308 source_set("allocator_extension_thunks") { | 312 source_set("allocator_extension_thunks") { |
| 309 visibility = [ "//base/*" ] | 313 visibility = [ "//base/*" ] |
| 310 sources = [ | 314 sources = [ |
| 311 "allocator_extension_thunks.cc", | 315 "allocator_extension_thunks.cc", |
| 312 "allocator_extension_thunks.h", | 316 "allocator_extension_thunks.h", |
| 313 ] | 317 ] |
| 314 if (is_android && !is_debug) { | 318 if (is_android && !is_debug) { |
| 315 configs -= [ "//build/config/compiler:default_optimization" ] | 319 configs -= [ "//build/config/compiler:default_optimization" ] |
| 316 configs += [ "//build/config/compiler:optimize_max" ] | 320 configs += [ "//build/config/compiler:optimize_max" ] |
| 317 } | 321 } |
| 318 } | 322 } |
| OLD | NEW |