summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorssid <ssid@chromium.org>2015-12-04 16:47:01 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-05 00:48:28 +0000
commit6ce6fb5acd3c68f0146c938fb7a669a6a2a44f28 (patch)
tree253dded949171aa84f1ce225d08723e361d7e9e2
parentfd64d4948c3429296b8992bb02743b019a0dce79 (diff)
downloadchromium_src-6ce6fb5acd3c68f0146c938fb7a669a6a2a44f28.zip
chromium_src-6ce6fb5acd3c68f0146c938fb7a669a6a2a44f28.tar.gz
chromium_src-6ce6fb5acd3c68f0146c938fb7a669a6a2a44f28.tar.bz2
Merge allocator and tcmalloc unittests and move to base_unittests
tcmalloc_unittests.cc was introduced to test tcmalloc's internals. Later allocator_unittest.cc added some extra tcmalloc-specific tests. As a matter of facts neither tcmalloc_unittests nor allocator_unittest is being run by any bot. This CL is merging them into a single translation unit and making them part of base_unittests since we don't want to add one more set of unittests on the bots. The recalloc test and aligned malloc for windows is removed since it was introduced to check the _aligned_malloc re-defined in allocator_shim.c (introduced in crrev.com/10828054), which has been later removed. Also, disabling some test in debug mode which are failing because the error messages in debug builds are different due to the debugallocation shim. BUG=564618 Review URL: https://codereview.chromium.org/1500733002 Cr-Commit-Position: refs/heads/master@{#363322}
-rw-r--r--base/BUILD.gn1
-rw-r--r--base/allocator/allocator.gyp40
-rw-r--r--base/allocator/allocator_unittest.cc245
-rw-r--r--base/allocator/tcmalloc_unittest.cc228
-rw-r--r--base/base.gyp1
-rw-r--r--build/gn_migration.gypi5
6 files changed, 179 insertions, 341 deletions
diff --git a/base/BUILD.gn b/base/BUILD.gn
index 2d1e5a3..6bc61d4 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -1259,6 +1259,7 @@ group("base_unittests_run") {
test("base_unittests") {
sources = [
+ "allocator/tcmalloc_unittest.cc",
"android/application_status_listener_unittest.cc",
"android/content_uri_utils_unittest.cc",
"android/jni_android_unittest.cc",
diff --git a/base/allocator/allocator.gyp b/base/allocator/allocator.gyp
index fa3a473..a49c268 100644
--- a/base/allocator/allocator.gyp
+++ b/base/allocator/allocator.gyp
@@ -377,9 +377,6 @@
], # conditions of 'allocator' target.
}, # 'allocator' target.
{
- # This library is linked in to src/base.gypi:base and allocator_unittests
- # It can't depend on either and nothing else should depend on it - all
- # other code should use the interfaced provided by base.
'target_name': 'allocator_extension_thunks',
'type': 'static_library',
'sources': [
@@ -417,24 +414,6 @@
},
],
},
- {
- 'target_name': 'allocator_unittests',
- 'type': 'executable',
- 'dependencies': [
- 'allocator',
- 'allocator_extension_thunks',
- '../../testing/gtest.gyp:gtest',
- ],
- 'include_dirs': [
- '.',
- '../..',
- ],
- 'sources': [
- '../profiler/alternate_timer.cc',
- '../profiler/alternate_timer.h',
- 'allocator_unittest.cc',
- ],
- },
],
}],
['OS=="win" and target_arch=="ia32"', {
@@ -458,24 +437,5 @@
},
],
}],
- ['use_allocator=="tcmalloc"', {
- 'targets': [
- {
- 'target_name': 'tcmalloc_unittest',
- 'type': 'executable',
- 'sources': [
- 'tcmalloc_unittest.cc',
- ],
- 'include_dirs': [
- '<(tcmalloc_dir)/src',
- '../..',
- ],
- 'dependencies': [
- '../../testing/gtest.gyp:gtest',
- 'allocator',
- ],
- },
- ],
- }],
],
}
diff --git a/base/allocator/allocator_unittest.cc b/base/allocator/allocator_unittest.cc
deleted file mode 100644
index a1d1ef0..0000000
--- a/base/allocator/allocator_unittest.cc
+++ /dev/null
@@ -1,245 +0,0 @@
-// 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.
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <algorithm> // for min()
-
-#include "base/macros.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-// Number of bits in a size_t.
-static const int kSizeBits = 8 * sizeof(size_t);
-// The maximum size of a size_t.
-static const size_t kMaxSize = ~static_cast<size_t>(0);
-// Maximum positive size of a size_t if it were signed.
-static const size_t kMaxSignedSize = ((size_t(1) << (kSizeBits-1)) - 1);
-
-namespace {
-
-using std::min;
-
-// Fill a buffer of the specified size with a predetermined pattern
-static void Fill(unsigned char* buffer, int n) {
- for (int i = 0; i < n; i++) {
- buffer[i] = (i & 0xff);
- }
-}
-
-// Check that the specified buffer has the predetermined pattern
-// generated by Fill()
-static bool Valid(unsigned char* buffer, int n) {
- for (int i = 0; i < n; i++) {
- if (buffer[i] != (i & 0xff)) {
- return false;
- }
- }
- return true;
-}
-
-// Check that a buffer is completely zeroed.
-static bool IsZeroed(unsigned char* buffer, int n) {
- for (int i = 0; i < n; i++) {
- if (buffer[i] != 0) {
- return false;
- }
- }
- return true;
-}
-
-// Check alignment
-static void CheckAlignment(void* p, int align) {
- EXPECT_EQ(0, reinterpret_cast<uintptr_t>(p) & (align-1));
-}
-
-// Return the next interesting size/delta to check. Returns -1 if no more.
-static int NextSize(int size) {
- if (size < 100)
- return size+1;
-
- if (size < 100000) {
- // Find next power of two
- int power = 1;
- while (power < size)
- power <<= 1;
-
- // Yield (power-1, power, power+1)
- if (size < power-1)
- return power-1;
-
- if (size == power-1)
- return power;
-
- assert(size == power);
- return power+1;
- } else {
- return -1;
- }
-}
-
-static void TestCalloc(size_t n, size_t s, bool ok) {
- char* p = reinterpret_cast<char*>(calloc(n, s));
- if (!ok) {
- EXPECT_EQ(NULL, p) << "calloc(n, s) should not succeed";
- } else {
- EXPECT_NE(reinterpret_cast<void*>(NULL), p) <<
- "calloc(n, s) should succeed";
- for (size_t i = 0; i < n*s; i++) {
- EXPECT_EQ('\0', p[i]);
- }
- free(p);
- }
-}
-
-} // namespace
-
-//-----------------------------------------------------------------------------
-
-
-TEST(Allocators, Malloc) {
- // Try allocating data with a bunch of alignments and sizes
- for (int size = 1; size < 1048576; size *= 2) {
- unsigned char* ptr = reinterpret_cast<unsigned char*>(malloc(size));
- CheckAlignment(ptr, 2); // Should be 2 byte aligned
- Fill(ptr, size);
- EXPECT_TRUE(Valid(ptr, size));
- free(ptr);
- }
-}
-
-TEST(Allocators, Calloc) {
- TestCalloc(0, 0, true);
- TestCalloc(0, 1, true);
- TestCalloc(1, 1, true);
- TestCalloc(1<<10, 0, true);
- TestCalloc(1<<20, 0, true);
- TestCalloc(0, 1<<10, true);
- TestCalloc(0, 1<<20, true);
- TestCalloc(1<<20, 2, true);
- TestCalloc(2, 1<<20, true);
- TestCalloc(1000, 1000, true);
-
- TestCalloc(kMaxSize, 2, false);
- TestCalloc(2, kMaxSize, false);
- TestCalloc(kMaxSize, kMaxSize, false);
-
- TestCalloc(kMaxSignedSize, 3, false);
- TestCalloc(3, kMaxSignedSize, false);
- TestCalloc(kMaxSignedSize, kMaxSignedSize, false);
-}
-
-// This makes sure that reallocing a small number of bytes in either
-// direction doesn't cause us to allocate new memory.
-TEST(Allocators, Realloc1) {
- int start_sizes[] = { 100, 1000, 10000, 100000 };
- int deltas[] = { 1, -2, 4, -8, 16, -32, 64, -128 };
-
- for (int s = 0; s < sizeof(start_sizes)/sizeof(*start_sizes); ++s) {
- void* p = malloc(start_sizes[s]);
- ASSERT_TRUE(p);
- // The larger the start-size, the larger the non-reallocing delta.
- for (int d = 0; d < s*2; ++d) {
- void* new_p = realloc(p, start_sizes[s] + deltas[d]);
- ASSERT_EQ(p, new_p); // realloc should not allocate new memory
- }
- // Test again, but this time reallocing smaller first.
- for (int d = 0; d < s*2; ++d) {
- void* new_p = realloc(p, start_sizes[s] - deltas[d]);
- ASSERT_EQ(p, new_p); // realloc should not allocate new memory
- }
- free(p);
- }
-}
-
-TEST(Allocators, Realloc2) {
- for (int src_size = 0; src_size >= 0; src_size = NextSize(src_size)) {
- for (int dst_size = 0; dst_size >= 0; dst_size = NextSize(dst_size)) {
- unsigned char* src = reinterpret_cast<unsigned char*>(malloc(src_size));
- Fill(src, src_size);
- unsigned char* dst =
- reinterpret_cast<unsigned char*>(realloc(src, dst_size));
- EXPECT_TRUE(Valid(dst, min(src_size, dst_size)));
- Fill(dst, dst_size);
- EXPECT_TRUE(Valid(dst, dst_size));
- if (dst != NULL) free(dst);
- }
- }
-
- // Now make sure realloc works correctly even when we overflow the
- // packed cache, so some entries are evicted from the cache.
- // The cache has 2^12 entries, keyed by page number.
- const int kNumEntries = 1 << 14;
- int** p = reinterpret_cast<int**>(malloc(sizeof(*p) * kNumEntries));
- int sum = 0;
- for (int i = 0; i < kNumEntries; i++) {
- // no page size is likely to be bigger than 8192?
- p[i] = reinterpret_cast<int*>(malloc(8192));
- p[i][1000] = i; // use memory deep in the heart of p
- }
- for (int i = 0; i < kNumEntries; i++) {
- p[i] = reinterpret_cast<int*>(realloc(p[i], 9000));
- }
- for (int i = 0; i < kNumEntries; i++) {
- sum += p[i][1000];
- free(p[i]);
- }
- EXPECT_EQ(kNumEntries/2 * (kNumEntries - 1), sum); // assume kNE is even
- free(p);
-}
-
-// Test recalloc
-TEST(Allocators, Recalloc) {
- for (int src_size = 0; src_size >= 0; src_size = NextSize(src_size)) {
- for (int dst_size = 0; dst_size >= 0; dst_size = NextSize(dst_size)) {
- unsigned char* src =
- reinterpret_cast<unsigned char*>(_recalloc(NULL, 1, src_size));
- EXPECT_TRUE(IsZeroed(src, src_size));
- Fill(src, src_size);
- unsigned char* dst =
- reinterpret_cast<unsigned char*>(_recalloc(src, 1, dst_size));
- EXPECT_TRUE(Valid(dst, min(src_size, dst_size)));
- Fill(dst, dst_size);
- EXPECT_TRUE(Valid(dst, dst_size));
- if (dst != NULL)
- free(dst);
- }
- }
-}
-
-// Test windows specific _aligned_malloc() and _aligned_free() methods.
-TEST(Allocators, AlignedMalloc) {
- // Try allocating data with a bunch of alignments and sizes
- static const int kTestAlignments[] = {8, 16, 256, 4096, 8192, 16384};
- for (int size = 1; size > 0; size = NextSize(size)) {
- for (int i = 0; i < arraysize(kTestAlignments); ++i) {
- unsigned char* ptr = static_cast<unsigned char*>(
- _aligned_malloc(size, kTestAlignments[i]));
- CheckAlignment(ptr, kTestAlignments[i]);
- Fill(ptr, size);
- EXPECT_TRUE(Valid(ptr, size));
-
- // Make a second allocation of the same size and alignment to prevent
- // allocators from passing this test by accident. Per jar, tcmalloc
- // provides allocations for new (never before seen) sizes out of a thread
- // local heap of a given "size class." Each time the test requests a new
- // size, it will usually get the first element of a span, which is a
- // 4K aligned allocation.
- unsigned char* ptr2 = static_cast<unsigned char*>(
- _aligned_malloc(size, kTestAlignments[i]));
- CheckAlignment(ptr2, kTestAlignments[i]);
- Fill(ptr2, size);
- EXPECT_TRUE(Valid(ptr2, size));
-
- // Should never happen, but sanity check just in case.
- ASSERT_NE(ptr, ptr2);
- _aligned_free(ptr);
- _aligned_free(ptr2);
- }
- }
-}
-
-int main(int argc, char** argv) {
- testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/base/allocator/tcmalloc_unittest.cc b/base/allocator/tcmalloc_unittest.cc
index 0f7082e..04a1466 100644
--- a/base/allocator/tcmalloc_unittest.cc
+++ b/base/allocator/tcmalloc_unittest.cc
@@ -1,96 +1,222 @@
// Copyright (c) 2012 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.
+
#include <stddef.h>
#include <stdio.h>
+#include "base/logging.h"
+#include "base/process/process_metrics.h"
+#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
-// TCMalloc header files.
-#include "common.h" // For TCMalloc constants like page size, etc.
-
-// TCMalloc implementation.
-#include "debugallocation_shim.cc"
+#if defined(USE_TCMALLOC)
+extern "C" {
+void* tc_malloc(size_t size);
+void tc_free(void*);
+}
namespace {
+using std::min;
+
+#ifdef NDEBUG
void* TCMallocDoMallocForTest(size_t size) {
- return do_malloc(size);
+ return tc_malloc(size);
}
void TCMallocDoFreeForTest(void* ptr) {
- do_free(ptr);
+ tc_free(ptr);
}
+#endif
-size_t ExcludeSpaceForMarkForTest(size_t size) {
- return ExcludeSpaceForMark(size);
+// Fill a buffer of the specified size with a predetermined pattern
+static void Fill(unsigned char* buffer, int n) {
+ for (int i = 0; i < n; i++) {
+ buffer[i] = (i & 0xff);
+ }
+}
+
+// Check that the specified buffer has the predetermined pattern
+// generated by Fill()
+static bool Valid(unsigned char* buffer, int n) {
+ for (int i = 0; i < n; i++) {
+ if (buffer[i] != (i & 0xff)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+// Return the next interesting size/delta to check. Returns -1 if no more.
+static int NextSize(int size) {
+ if (size < 100)
+ return size + 1;
+
+ if (size < 100000) {
+ // Find next power of two
+ int power = 1;
+ while (power < size)
+ power <<= 1;
+
+ // Yield (power-1, power, power+1)
+ if (size < power - 1)
+ return power - 1;
+
+ if (size == power - 1)
+ return power;
+
+ CHECK_EQ(size, power);
+ return power + 1;
+ } else {
+ return -1;
+ }
+}
+
+static void TestCalloc(size_t n, size_t s, bool ok) {
+ char* p = reinterpret_cast<char*>(calloc(n, s));
+ if (!ok) {
+ EXPECT_EQ(NULL, p) << "calloc(n, s) should not succeed";
+ } else {
+ EXPECT_NE(reinterpret_cast<void*>(NULL), p)
+ << "calloc(n, s) should succeed";
+ for (size_t i = 0; i < n * s; i++) {
+ EXPECT_EQ('\0', p[i]);
+ }
+ free(p);
+ }
}
} // namespace
-TEST(TCMallocFreeCheck, BadPointerInFirstPageOfTheLargeObject) {
- char* p = reinterpret_cast<char*>(
- TCMallocDoMallocForTest(ExcludeSpaceForMarkForTest(kMaxSize + 1)));
- for (int offset = 1; offset < kPageSize ; offset <<= 1) {
+TEST(TCMallocTest, Malloc) {
+ // Try allocating data with a bunch of alignments and sizes
+ for (int size = 1; size < 1048576; size *= 2) {
+ unsigned char* ptr = reinterpret_cast<unsigned char*>(malloc(size));
+ // Should be 2 byte aligned
+ EXPECT_EQ(0u, reinterpret_cast<uintptr_t>(ptr) & 1);
+ Fill(ptr, size);
+ EXPECT_TRUE(Valid(ptr, size));
+ free(ptr);
+ }
+}
+
+TEST(TCMallocTest, Calloc) {
+ TestCalloc(0, 0, true);
+ TestCalloc(0, 1, true);
+ TestCalloc(1, 1, true);
+ TestCalloc(1 << 10, 0, true);
+ TestCalloc(1 << 20, 0, true);
+ TestCalloc(0, 1 << 10, true);
+ TestCalloc(0, 1 << 20, true);
+ TestCalloc(1 << 20, 2, true);
+ TestCalloc(2, 1 << 20, true);
+ TestCalloc(1000, 1000, true);
+}
+
+#ifdef NDEBUG
+// This makes sure that reallocing a small number of bytes in either
+// direction doesn't cause us to allocate new memory. Tcmalloc in debug mode
+// does not follow this.
+TEST(TCMallocTest, ReallocSmallDelta) {
+ int start_sizes[] = {100, 1000, 10000, 100000};
+ int deltas[] = {1, -2, 4, -8, 16, -32, 64, -128};
+
+ for (unsigned s = 0; s < sizeof(start_sizes) / sizeof(*start_sizes); ++s) {
+ void* p = malloc(start_sizes[s]);
+ ASSERT_TRUE(p);
+ // The larger the start-size, the larger the non-reallocing delta.
+ for (unsigned d = 0; d < s * 2; ++d) {
+ void* new_p = realloc(p, start_sizes[s] + deltas[d]);
+ ASSERT_EQ(p, new_p); // realloc should not allocate new memory
+ }
+ // Test again, but this time reallocing smaller first.
+ for (unsigned d = 0; d < s * 2; ++d) {
+ void* new_p = realloc(p, start_sizes[s] - deltas[d]);
+ ASSERT_EQ(p, new_p); // realloc should not allocate new memory
+ }
+ free(p);
+ }
+}
+#endif
+
+TEST(TCMallocTest, Realloc) {
+ for (int src_size = 0; src_size >= 0; src_size = NextSize(src_size)) {
+ for (int dst_size = 0; dst_size >= 0; dst_size = NextSize(dst_size)) {
+ unsigned char* src = reinterpret_cast<unsigned char*>(malloc(src_size));
+ Fill(src, src_size);
+ unsigned char* dst =
+ reinterpret_cast<unsigned char*>(realloc(src, dst_size));
+ EXPECT_TRUE(Valid(dst, min(src_size, dst_size)));
+ Fill(dst, dst_size);
+ EXPECT_TRUE(Valid(dst, dst_size));
+ if (dst != NULL)
+ free(dst);
+ }
+ }
+
+ // Now make sure realloc works correctly even when we overflow the
+ // packed cache, so some entries are evicted from the cache.
+ // The cache has 2^12 entries, keyed by page number.
+ const int kNumEntries = 1 << 14;
+ int** p = reinterpret_cast<int**>(malloc(sizeof(*p) * kNumEntries));
+ int sum = 0;
+ for (int i = 0; i < kNumEntries; i++) {
+ // no page size is likely to be bigger than 8192?
+ p[i] = reinterpret_cast<int*>(malloc(8192));
+ p[i][1000] = i; // use memory deep in the heart of p
+ }
+ for (int i = 0; i < kNumEntries; i++) {
+ p[i] = reinterpret_cast<int*>(realloc(p[i], 9000));
+ }
+ for (int i = 0; i < kNumEntries; i++) {
+ sum += p[i][1000];
+ free(p[i]);
+ }
+ EXPECT_EQ(kNumEntries / 2 * (kNumEntries - 1), sum); // assume kNE is even
+ free(p);
+}
+
+#ifdef NDEBUG
+TEST(TCMallocFreeTest, BadPointerInFirstPageOfTheLargeObject) {
+ const size_t kPageSize = base::GetPageSize();
+ char* p =
+ reinterpret_cast<char*>(TCMallocDoMallocForTest(10 * kPageSize + 1));
+ for (unsigned offset = 1; offset < kPageSize; offset <<= 1) {
ASSERT_DEATH(TCMallocDoFreeForTest(p + offset),
"Pointer is not pointing to the start of a span");
}
}
-TEST(TCMallocFreeCheck, BadPageAlignedPointerInsideLargeObject) {
- char* p = reinterpret_cast<char*>(
- TCMallocDoMallocForTest(ExcludeSpaceForMarkForTest(kMaxSize + 1)));
+TEST(TCMallocFreeTest, BadPageAlignedPointerInsideLargeObject) {
+ const size_t kPageSize = base::GetPageSize();
+ const size_t kMaxSize = 10 * kPageSize;
+ char* p = reinterpret_cast<char*>(TCMallocDoMallocForTest(kMaxSize + 1));
- for (int offset = kPageSize; offset < kMaxSize; offset += kPageSize) {
+ for (unsigned offset = kPageSize; offset < kMaxSize; offset += kPageSize) {
// Only the first and last page of a span are in heap map. So for others
// tcmalloc will give a general error of invalid pointer.
- ASSERT_DEATH(TCMallocDoFreeForTest(p + offset),
- "Attempt to free invalid pointer");
+ ASSERT_DEATH(TCMallocDoFreeForTest(p + offset), "");
}
ASSERT_DEATH(TCMallocDoFreeForTest(p + kMaxSize),
"Pointer is not pointing to the start of a span");
}
-TEST(TCMallocFreeCheck, DoubleFreeLargeObject) {
- char* p = reinterpret_cast<char*>(
- TCMallocDoMallocForTest(ExcludeSpaceForMarkForTest(kMaxSize + 1)));
+TEST(TCMallocFreeTest, DoubleFreeLargeObject) {
+ const size_t kMaxSize = 10 * base::GetPageSize();
+ char* p = reinterpret_cast<char*>(TCMallocDoMallocForTest(kMaxSize + 1));
ASSERT_DEATH(TCMallocDoFreeForTest(p); TCMallocDoFreeForTest(p),
"Object was not in-use");
}
-
-#ifdef NDEBUG
-TEST(TCMallocFreeCheck, DoubleFreeSmallObject) {
- for (size_t size = 1;
- size <= ExcludeSpaceForMarkForTest(kMaxSize);
- size <<= 1) {
+TEST(TCMallocFreeTest, DoubleFreeSmallObject) {
+ const size_t kPageSize = base::GetPageSize();
+ for (size_t size = 1; size <= kPageSize; size <<= 1) {
char* p = reinterpret_cast<char*>(TCMallocDoMallocForTest(size));
ASSERT_DEATH(TCMallocDoFreeForTest(p); TCMallocDoFreeForTest(p),
"Circular loop in list detected");
}
}
-#else
-TEST(TCMallocFreeCheck, DoubleFreeSmallObject) {
- size_t size = 1;
-
- // When the object is small, tcmalloc validation can not distinguish normal
- // memory corruption or double free, because there's not enough space in
- // freed objects to keep the mark.
- for (; size <= ExcludeSpaceForMarkForTest(kMinClassSize); size <<= 1) {
- char* p = reinterpret_cast<char*>(TCMallocDoMallocForTest(size));
- ASSERT_DEATH(TCMallocDoFreeForTest(p); TCMallocDoFreeForTest(p),
- "Memory corrupted");
- }
+#endif // NDEBUG
- for (; size <= ExcludeSpaceForMarkForTest(kMaxSize); size <<= 1) {
- char* p = reinterpret_cast<char*>(TCMallocDoMallocForTest(size));
- ASSERT_DEATH(TCMallocDoFreeForTest(p); TCMallocDoFreeForTest(p),
- "Attempt to double free");
- }
-}
#endif
-
-int main(int argc, char **argv) {
- testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/base/base.gyp b/base/base.gyp
index 8fa0524..e067154bd 100644
--- a/base/base.gyp
+++ b/base/base.gyp
@@ -427,6 +427,7 @@
'target_name': 'base_unittests',
'type': '<(gtest_target_type)',
'sources': [
+ 'allocator/tcmalloc_unittest.cc',
'android/application_status_listener_unittest.cc',
'android/content_uri_utils_unittest.cc',
'android/jni_android_unittest.cc',
diff --git a/build/gn_migration.gypi b/build/gn_migration.gypi
index dc2a6c5..3861cef 100644
--- a/build/gn_migration.gypi
+++ b/build/gn_migration.gypi
@@ -727,11 +727,6 @@
'../tools/win/static_initializers/static_initializers.gyp:static_initializers',
],
}],
- ['OS=="win" and win_use_allocator_shim==1', {
- 'dependencies': [
- '../base/allocator/allocator.gyp:allocator_unittests',
- ]
- }],
['OS=="win" and target_arch=="ia32"', {
'dependencies': [
# TODO(GYP): All of these targets need to be ported over.