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

Unified Diff: base/allocator/BUILD.gn

Issue 1675143004: Allocator shim skeleton + Linux impl behind a build flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shim_exp_flag
Patch Set: rebase Created 4 years, 10 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
Index: base/allocator/BUILD.gn
diff --git a/base/allocator/BUILD.gn b/base/allocator/BUILD.gn
index 0049800cb8620724cc14d2985aace93d85c195a7..25e18f7a969bdc3cffb4a79243f22378b231ec5c 100644
--- a/base/allocator/BUILD.gn
+++ b/base/allocator/BUILD.gn
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//build/buildflag_header.gni")
import("//build/config/allocator.gni")
import("//build/config/compiler/compiler.gni")
@@ -294,3 +295,34 @@ if (use_allocator == "tcmalloc") {
deps += [ "//base/third_party/dynamic_annotations" ]
}
} # use_allocator == "tcmalloc"
+
+buildflag_header("features") {
+ header = "features.h"
+ flags = [ "USE_EXPERIMENTAL_ALLOCATOR_SHIM=$use_experimental_allocator_shim" ]
+}
+
+if (use_experimental_allocator_shim) {
+ source_set("unified_allocator_shim") {
+ # TODO(primiano): support other platforms, currently this works only on
+ # Linux/CrOS only. http://crbug.com/550886 .
Nico 2016/03/08 03:08:42 remove one of the two "only"
Primiano Tucci (use gerrit) 2016/03/08 20:54:05 But it was so symmetric :) Done.
+ configs += [ "//base:base_implementation" ] # for BASE_EXPORT
Nico 2016/03/08 03:08:41 give this visibility = [ ":base" ] too, to m
Primiano Tucci (use gerrit) 2016/03/08 20:54:04 TIL visibility in GN. Done.
+ sources = [
+ "allocator_shim.cc",
+ "allocator_shim.h",
+ "allocator_shim_internals.h",
+ "allocator_shim_override_cpp_symbols.h",
+ "allocator_shim_override_libc_symbols.h",
+ ]
+ if (is_linux && use_allocator == "tcmalloc") {
+ sources += [
+ "allocator_shim_default_dispatch_to_tcmalloc.cc",
+ "allocator_shim_override_glibc_weak_symbols.h",
+ ]
+ deps = [
+ ":tcmalloc",
+ ]
+ } else if (is_linux && use_allocator == "none") {
+ sources += [ "allocator_shim_default_dispatch_to_glibc.cc" ]
+ }
+ }
+}
« no previous file with comments | « base/BUILD.gn ('k') | base/allocator/allocator.gyp » ('j') | base/allocator/allocator_shim.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698