Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(720)

Unified Diff: build/config/allocator.gni

Issue 2023703002: Beginning work on GN build (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Really add //build. Add dart_bootstrap rule. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/OWNERS ('k') | build/config/android/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/allocator.gni
diff --git a/build/config/allocator.gni b/build/config/allocator.gni
new file mode 100644
index 0000000000000000000000000000000000000000..06447af0b40660b00525bea0eea90b131a9ef6a2
--- /dev/null
+++ b/build/config/allocator.gni
@@ -0,0 +1,35 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/sanitizers/sanitizers.gni")
+
+if (is_android || current_cpu == "mipsel" || is_mac || is_ios || is_asan ||
+ is_lsan || is_tsan || is_msan || is_win || is_syzyasan) {
+ _default_allocator = "none"
+} else {
+ _default_allocator = "tcmalloc"
+}
+
+if ((is_linux || is_android) && !is_asan && !is_lsan && !is_tsan && !is_msan) {
+ _default_use_experimental_allocator_shim = true
+} else {
+ _default_use_experimental_allocator_shim = false
+}
+
+declare_args() {
+ # Memory allocator to use. Set to "none" to use default allocator.
+ use_allocator = _default_allocator
+
+ # TODO(primiano): this should just become the default without having a flag,
+ # but we need to get there first. http://crbug.com/550886 .
+ # Causes all the allocations to be routed via allocator_shim.cc.
+ use_experimental_allocator_shim = _default_use_experimental_allocator_shim
+}
+
+assert(use_allocator == "none" || use_allocator == "tcmalloc")
+
+assert(!is_win || use_allocator == "none", "Tcmalloc doesn't work on Windows.")
+assert(
+ !use_experimental_allocator_shim || is_linux || is_android,
+ "use_experimental_allocator_shim supported only on Linux and Android targets")
« no previous file with comments | « build/config/OWNERS ('k') | build/config/android/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698