| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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/sanitizers/sanitizers.gni") | 5 import("//build/config/sanitizers/sanitizers.gni") |
| 6 | 6 |
| 7 # Temporarily disable tcmalloc on arm64 linux to get rid of compilation errors. | 7 # Temporarily disable tcmalloc on arm64 linux to get rid of compilation errors. |
| 8 if (is_android || current_cpu == "mipsel" || is_mac || is_ios || is_asan || | 8 if (is_android || current_cpu == "mipsel" || is_mac || is_ios || is_asan || |
| 9 is_lsan || is_tsan || is_msan || is_win || is_syzyasan || | 9 is_lsan || is_tsan || is_msan || is_win || is_syzyasan || |
| 10 (is_linux && target_cpu == "arm64")) { | 10 (is_linux && target_cpu == "arm64")) { |
| 11 _default_allocator = "none" | 11 _default_allocator = "none" |
| 12 } else { | 12 } else { |
| 13 _default_allocator = "tcmalloc" | 13 _default_allocator = "tcmalloc" |
| 14 } | 14 } |
| 15 | 15 |
| 16 if ((is_linux || is_android) && !is_asan && !is_lsan && !is_tsan && !is_msan) { | 16 if ((is_linux || is_android || (is_win && !is_component_build)) && !is_asan && |
| 17 !is_lsan && !is_tsan && !is_msan) { |
| 17 _default_use_experimental_allocator_shim = true | 18 _default_use_experimental_allocator_shim = true |
| 18 } else { | 19 } else { |
| 19 _default_use_experimental_allocator_shim = false | 20 _default_use_experimental_allocator_shim = false |
| 20 } | 21 } |
| 21 | 22 |
| 22 declare_args() { | 23 declare_args() { |
| 23 # Memory allocator to use. Set to "none" to use default allocator. | 24 # Memory allocator to use. Set to "none" to use default allocator. |
| 24 use_allocator = _default_allocator | 25 use_allocator = _default_allocator |
| 25 | 26 |
| 26 # TODO(primiano): this should just become the default without having a flag, | 27 # TODO(primiano): this should just become the default without having a flag, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 40 assert(!is_win || use_allocator == "none", "Tcmalloc doesn't work on Windows.") | 41 assert(!is_win || use_allocator == "none", "Tcmalloc doesn't work on Windows.") |
| 41 | 42 |
| 42 assert( | 43 assert( |
| 43 !use_experimental_allocator_shim || is_linux || is_android || is_win, | 44 !use_experimental_allocator_shim || is_linux || is_android || is_win, |
| 44 "use_experimental_allocator_shim supported only on Linux, Android and Window
s targets") | 45 "use_experimental_allocator_shim supported only on Linux, Android and Window
s targets") |
| 45 | 46 |
| 46 if (is_win && use_experimental_allocator_shim) { | 47 if (is_win && use_experimental_allocator_shim) { |
| 47 assert(!is_component_build, | 48 assert(!is_component_build, |
| 48 "The allocator shim doesn't work for the component build on Windows.") | 49 "The allocator shim doesn't work for the component build on Windows.") |
| 49 } | 50 } |
| OLD | NEW |