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

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: Created 4 years, 9 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
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 c45c657dae06e3100c97c78d58634360673462ca..4ea517b780061a4c6ddc1a598c82457c8bed44bc 100644
--- a/third_party/WebKit/Source/platform/heap/HeapTest.cpp
+++ b/third_party/WebKit/Source/platform/heap/HeapTest.cpp
@@ -2371,6 +2371,25 @@ TEST(HeapTest, LargeHeapObjects)
preciselyCollectGarbage();
}
+TEST(HeapTest, LargeHashMap)
+{
+ clearOutOldGarbage();
+
+ size_t size = (1 << 27) / sizeof(int);
+ Persistent<HeapHashMap<int, int>> map = new HeapHashMap<int, int>();
+ 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;

Powered by Google App Engine
This is Rietveld 408576698