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

Unified Diff: Source/wtf/PartitionAllocTest.cpp

Issue 301743006: Report DOM partitionAlloc size to V8 GC. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add unittest / fix windows Created 6 years, 6 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 | « Source/wtf/PartitionAlloc.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/PartitionAllocTest.cpp
diff --git a/Source/wtf/PartitionAllocTest.cpp b/Source/wtf/PartitionAllocTest.cpp
index 14a4c32fe69c0ac1f416f2a171cb4566e440e7a6..06546a676ccc19935fec0334f282f10ba0fca312 100644
--- a/Source/wtf/PartitionAllocTest.cpp
+++ b/Source/wtf/PartitionAllocTest.cpp
@@ -990,6 +990,8 @@ TEST(PartitionAllocTest, FreeCache)
{
TestSetup();
+ EXPECT_EQ(0U, allocator.root()->totalSizeOfCommittedPages);
+
size_t bigSize = allocator.root()->maxAllocation - kExtraAllocSize;
size_t bucketIdx = (bigSize + kExtraAllocSize) >> WTF::kBucketShift;
WTF::PartitionBucket* bucket = &allocator.root()->buckets()[bucketIdx];
@@ -999,6 +1001,7 @@ TEST(PartitionAllocTest, FreeCache)
WTF::PartitionPage* page = WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr));
EXPECT_EQ(0, bucket->freePagesHead);
EXPECT_EQ(1, page->numAllocatedSlots);
+ EXPECT_EQ(WTF::kPartitionPageSize, allocator.root()->totalSizeOfCommittedPages);
partitionFree(ptr);
EXPECT_EQ(0, page->numAllocatedSlots);
EXPECT_NE(-1, page->freeCacheIndex);
@@ -1010,6 +1013,8 @@ TEST(PartitionAllocTest, FreeCache)
EXPECT_FALSE(page->freelistHead);
EXPECT_EQ(-1, page->freeCacheIndex);
EXPECT_EQ(0, page->numAllocatedSlots);
+ WTF::PartitionBucket* cycleFreeCacheBucket = &allocator.root()->buckets()[kTestBucketIndex];
+ EXPECT_EQ(cycleFreeCacheBucket->numSystemPagesPerSlotSpan * WTF::kSystemPageSize, allocator.root()->totalSizeOfCommittedPages);
// Check that an allocation works ok whilst in this state (a free'd page
// as the active pages head).
@@ -1025,7 +1030,7 @@ TEST(PartitionAllocTest, FreeCache)
partitionFree(ptr);
EXPECT_TRUE(page->freelistHead);
}
-
+ EXPECT_EQ(WTF::kPartitionPageSize, allocator.root()->totalSizeOfCommittedPages);
TestShutdown();
}
« no previous file with comments | « Source/wtf/PartitionAlloc.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698