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

Unified Diff: third_party/WebKit/Source/platform/heap/HeapTest.cpp

Issue 1842263004: Large heap collection type hits assertion in Heap::allocationSizeFromSize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 | « third_party/WebKit/Source/platform/heap/Heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/HeapTest.cpp
diff --git a/third_party/WebKit/Source/platform/heap/HeapTest.cpp b/third_party/WebKit/Source/platform/heap/HeapTest.cpp
index 5f7d8fd1a837e4340b1827b95080b253a1bf2965..94f89f280aadda1394548dfc09a39d0279ba1c82 100644
--- a/third_party/WebKit/Source/platform/heap/HeapTest.cpp
+++ b/third_party/WebKit/Source/platform/heap/HeapTest.cpp
@@ -2425,6 +2425,25 @@ TEST(HeapTest, LargeHeapObjects)
preciselyCollectGarbage();
}
+TEST(HeapTest, LargeHashMap)
+{
+ clearOutOldGarbage();
+
+ size_t size = (1 << 27) / sizeof(int);
+ Persistent<HeapHashMap<int, Member<IntWrapper>>> map = new HeapHashMap<int, Member<IntWrapper>>();
+ map->reserveCapacityForSize(size);
+ EXPECT_LE(size, map->capacity());
+}
+
+TEST(HeapTest, LargeVector)
+{
+ clearOutOldGarbage();
+
+ size_t size = (1 << 27) / sizeof(int);
+ Persistent<HeapVector<int>> vector = new HeapVector<int>(size);
+ EXPECT_LE(size, vector->capacity());
+}
+
typedef std::pair<Member<IntWrapper>, int> PairWrappedUnwrapped;
typedef std::pair<int, Member<IntWrapper>> PairUnwrappedWrapped;
typedef std::pair<WeakMember<IntWrapper>, Member<IntWrapper>> PairWeakStrong;
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698