Commit 5c83696a authored by Bartek Nowierski's avatar Bartek Nowierski Committed by Commit Bot

Rip out tag test for direct-map

Tags aren't implemented for direct-map, hence remove the unit test
entirely.

Technically, we should also prevent allocate size from being increased
by kInSlotTagBufferSize on that path, but that's too much effort.

Bug: 1092288
Change-Id: Iecffe61120bd4f9c0e9321040338eda44b3dbc66
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2306121
Commit-Queue: Bartek Nowierski <bartekn@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarTakashi Sakamoto <tasak@google.com>
Cr-Commit-Position: refs/heads/master@{#789891}
parent ff03b241
......@@ -2565,43 +2565,6 @@ TEST_F(PartitionAllocTest, TagBasic) {
#endif
#if ENABLE_TAG_FOR_CHECKED_PTR2
TEST_F(PartitionAllocTest, TagForDirectMap) {
size_t request_size = kGenericMinDirectMappedDownsize + kExtraAllocSize;
void* ptr1 = allocator.root()->Alloc(request_size, type_name);
void* ptr2 = allocator.root()->Alloc(request_size, type_name);
EXPECT_TRUE(ptr1);
EXPECT_TRUE(ptr2);
PartitionRoot<ThreadSafe>::Page* page =
PartitionRoot<ThreadSafe>::Page::FromPointer(
PartitionPointerAdjustSubtract(true, ptr1));
EXPECT_TRUE(page);
constexpr PartitionTag kTag1 = 0xBADA;
constexpr PartitionTag kTag2 = 0xDB8A;
constexpr size_t unused_size = 0;
PartitionTagSetValue(ptr1, unused_size, kTag1);
PartitionTagSetValue(ptr2, unused_size, kTag2);
memset(ptr1, 0, request_size);
memset(ptr2, 0, request_size);
EXPECT_EQ(kTag1, PartitionTagGetValue(ptr1));
EXPECT_EQ(kTag2, PartitionTagGetValue(ptr2));
EXPECT_TRUE(!memchr(ptr1, static_cast<uint8_t>(kTag1 >> 8), kTestAllocSize));
EXPECT_TRUE(!memchr(ptr1, static_cast<uint8_t>(kTag1), kTestAllocSize));
EXPECT_TRUE(!memchr(ptr2, static_cast<uint8_t>(kTag2 >> 8), kTestAllocSize));
EXPECT_TRUE(!memchr(ptr2, static_cast<uint8_t>(kTag2), kTestAllocSize));
allocator.root()->Free(ptr1);
EXPECT_EQ(kTag2, PartitionTagGetValue(ptr2));
allocator.root()->Free(ptr2);
}
#endif
} // namespace internal
} // namespace base
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment