Commit a17905e3 authored by Yuki Shiino's avatar Yuki Shiino Committed by Commit Bot

base/allocator: Small refactoring of allocator.gni

Relaxes a restriction of use_allocator != "partition" a little
so that we can specify use_allocator = "partition" for testing
purposes.  Note that use_allocator never be "partition" unless
we explicitly specify it, so there is no change on all bots
(until we will actually ship it).

Bug: 1121427
Change-Id: Ib06997385f864f1ba097edb46eeed3a215105911
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2463088Reviewed-by: default avatarBartek Nowierski <bartekn@chromium.org>
Reviewed-by: default avatarWill Harris <wfh@chromium.org>
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815694}
parent 777ff4b2
...@@ -5,16 +5,6 @@ ...@@ -5,16 +5,6 @@
import("//build/config/chromecast_build.gni") import("//build/config/chromecast_build.gni")
import("//build/config/sanitizers/sanitizers.gni") import("//build/config/sanitizers/sanitizers.gni")
# Temporarily disable tcmalloc on arm64 linux to get rid of compilation errors.
if (is_android || is_apple || is_asan || is_lsan || is_tsan || is_msan ||
is_win || is_fuchsia ||
((is_linux || is_chromeos) && target_cpu == "arm64") ||
(is_cast_audio_only && target_cpu == "arm")) {
_default_allocator = "none"
} else {
_default_allocator = "tcmalloc"
}
# The debug CRT on Windows has some debug features that are incompatible with # The debug CRT on Windows has some debug features that are incompatible with
# the shim. NaCl in particular does seem to link some binaries statically # the shim. NaCl in particular does seem to link some binaries statically
# against the debug CRT with "is_nacl=false". # against the debug CRT with "is_nacl=false".
...@@ -26,7 +16,20 @@ if ((is_linux || is_chromeos || is_android || is_apple || ...@@ -26,7 +16,20 @@ if ((is_linux || is_chromeos || is_android || is_apple ||
_default_use_allocator_shim = false _default_use_allocator_shim = false
} }
# Temporarily disable tcmalloc on arm64 linux to get rid of compilation errors.
if (is_android || is_apple || is_asan || is_lsan || is_tsan || is_msan ||
is_win || is_fuchsia ||
((is_linux || is_chromeos) && target_cpu == "arm64") ||
(is_cast_audio_only && target_cpu == "arm")) {
_default_allocator = "none"
} else {
_default_allocator = "tcmalloc"
}
declare_args() { declare_args() {
# Don't ship this configuration, not ready yet.
assert(_default_allocator != "partition")
# Memory allocator to use. Set to "none" to use default allocator. # Memory allocator to use. Set to "none" to use default allocator.
use_allocator = _default_allocator use_allocator = _default_allocator
...@@ -57,9 +60,6 @@ if (!use_partition_alloc && use_allocator == "partition") { ...@@ -57,9 +60,6 @@ if (!use_partition_alloc && use_allocator == "partition") {
assert(use_allocator == "none" || use_allocator == "tcmalloc" || assert(use_allocator == "none" || use_allocator == "tcmalloc" ||
use_allocator == "partition") use_allocator == "partition")
# Don't ship this configuration, not ready yet.
assert(!(use_allocator == "partition" && is_official_build))
assert(!is_win || use_allocator != "tcmalloc", assert(!is_win || use_allocator != "tcmalloc",
"Tcmalloc doesn't work on Windows.") "Tcmalloc doesn't work on Windows.")
assert(!is_mac || use_allocator != "tcmalloc", assert(!is_mac || use_allocator != "tcmalloc",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment