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

Unified Diff: base/allocator/BUILD.gn

Issue 1246083005: Work on Windows GN allocator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | « no previous file | build/config/allocator.gni » ('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 c42de1a01a38900bdbf8e23029ffeb9b78441c61..8944ad4397438276c42fd87b069c3e99ba549925 100644
--- a/base/allocator/BUILD.gn
+++ b/base/allocator/BUILD.gn
@@ -9,10 +9,26 @@ import("//build/config/allocator.gni")
# This "allocator" meta-target will forward to the default allocator according
# to the build settings.
group("allocator") {
+ public_deps = []
if (use_allocator == "tcmalloc") {
- deps = [
- ":tcmalloc",
- ]
+ public_deps += [ ":tcmalloc" ]
+ }
+
+ # This condition expresses the win_use_allocator_shim in the GYP build.
+ if (is_win && !is_component_build) {
+ public_deps += [ ":allocator_shim" ]
+ }
+}
+
+# This config defines ALLOCATOR_SHIM in the same conditions that the allocator
+# shim will be used by the allocator target.
+#
+# TODO(brettw) this is only used in one place and is kind of mess, because it
+# assumes that the library using it will eventually be linked with
+# //base/allocator in the default way. Clean this up and delete this.
+config("allocator_shim_define") {
+ if (is_win && !is_component_build) {
+ defines = [ "ALLOCATOR_SHIM" ]
}
}
@@ -39,6 +55,19 @@ if (is_win) {
current_cpu,
]
}
+
+ source_set("allocator_shim") {
+ sources = [
+ "allocator_shim_win.cc",
+ ]
+ configs -= [ "//build/config/compiler:chromium_code" ]
+ configs += [ "//build/config/compiler:no_chromium_code" ]
+
+ public_configs = [ ":nocmt" ]
+ deps = [
+ ":prep_libc",
+ ]
+ }
}
if (use_allocator == "tcmalloc") {
@@ -149,7 +178,6 @@ if (use_allocator == "tcmalloc") {
"$tcmalloc_dir/src/thread_cache.h",
"$tcmalloc_dir/src/windows/port.cc",
"$tcmalloc_dir/src/windows/port.h",
- "allocator_shim.cc",
"debugallocation_shim.cc",
# These are both #included by allocator_shim for maximal linking.
@@ -185,9 +213,6 @@ if (use_allocator == "tcmalloc") {
"$tcmalloc_dir/src/system-alloc.cc",
"$tcmalloc_dir/src/system-alloc.h",
- # included by allocator_shim.cc
- "debugallocation_shim.cc",
-
# cpuprofiler
"$tcmalloc_dir/src/base/thread_lister.c",
"$tcmalloc_dir/src/base/thread_lister.h",
@@ -215,9 +240,6 @@ if (use_allocator == "tcmalloc") {
"$tcmalloc_dir/src/system-alloc.h",
"$tcmalloc_dir/src/windows/port.cc",
"$tcmalloc_dir/src/windows/port.h",
-
- # TODO(willchan): Support allocator shim later on.
- "allocator_shim.cc",
]
# We enable all warnings by default, but upstream disables a few.
« no previous file with comments | « no previous file | build/config/allocator.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698