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

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: Make self the 1st arg Created 4 years, 9 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 | « base/BUILD.gn ('k') | base/allocator/allocator.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/allocator/BUILD.gn
diff --git a/base/allocator/BUILD.gn b/base/allocator/BUILD.gn
index 0049800cb8620724cc14d2985aace93d85c195a7..887d544f197862bbdb746d65bbd6e4db906ba7fb 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,35 @@ 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. http://crbug.com/550886 .
+ configs += [ "//base:base_implementation" ] # for BASE_EXPORT
+ visibility = [ "//base:base" ]
+ 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698