Index: base/allocator/BUILD.gn |
diff --git a/base/allocator/BUILD.gn b/base/allocator/BUILD.gn |
index d25239ae6f849ea320cb44f72ea7c734c7883cd6..7f57e6b2056671ed2ecf6a283b58a3417d5acf44 100644 |
--- a/base/allocator/BUILD.gn |
+++ b/base/allocator/BUILD.gn |
@@ -13,8 +13,10 @@ declare_args() { |
enable_debugallocation = is_debug |
} |
-# Allocator shim is only enabled for Release static builds. |
-win_use_allocator_shim = is_win && !is_component_build && !is_debug |
+# The Windows-only allocator shim is only enabled for Release static builds, and |
+# is mutually exclusive with the generalized shim. |
+win_use_allocator_shim = is_win && !is_component_build && !is_debug && |
+ !use_experimental_allocator_shim |
# This "allocator" meta-target will forward to the default allocator according |
# to the build settings. |
@@ -38,9 +40,7 @@ group("allocator") { |
# 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 (win_use_allocator_shim) { |
- defines = [ "ALLOCATOR_SHIM" ] |
- } |
+ defines = [ "ALLOCATOR_SHIM" ] |
Primiano Tucci (use gerrit)
2016/07/12 14:51:04
If I am understanding this correctly you are dropp
Sigurður Ásgeirsson
2016/07/14 19:04:26
Done.
|
} |
config("tcmalloc_flags") { |
@@ -79,6 +79,8 @@ config("tcmalloc_flags") { |
if (win_use_allocator_shim) { |
source_set("allocator_shim") { |
sources = [ |
+ "allocator_impl_win.cc", |
Primiano Tucci (use gerrit)
2016/07/12 14:51:04
I think just for the sake of making all these file
Sigurður Ásgeirsson
2016/07/14 19:04:26
Done.
|
+ "allocator_impl_win.h", |
"allocator_shim_win.cc", |
"allocator_shim_win.h", |
] |
@@ -302,7 +304,18 @@ if (use_experimental_allocator_shim) { |
"allocator_shim_override_cpp_symbols.h", |
"allocator_shim_override_libc_symbols.h", |
] |
- if (is_linux && use_allocator == "tcmalloc") { |
+ if (is_win) { |
+ sources += [ |
+ "allocator_impl_win.cc", |
+ "allocator_impl_win.h", |
+ ] |
+ |
+ # This gates tests that require the presence of the allocator shim. |
+ configs += [ ":allocator_shim_define" ] |
Primiano Tucci (use gerrit)
2016/07/12 14:51:04
if you follow my suggestion above about having the
Sigurður Ásgeirsson
2016/07/14 19:04:26
Done.
|
+ } |
+ if (is_win) { |
+ sources += [ "allocator_shim_default_dispatch_to_winheap.cc" ] |
+ } else if (is_linux && use_allocator == "tcmalloc") { |
sources += [ |
"allocator_shim_default_dispatch_to_tcmalloc.cc", |
"allocator_shim_override_glibc_weak_symbols.h", |