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

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

Issue 2816373003: Oilpan: Allow clearing a vector during pre finalizer to disallocate the backing buffer (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | third_party/WebKit/Source/platform/wtf/Vector.h » ('j') | 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 0448e3b7b4bf482d2a6ef4fad9e8fb7a3f516bf5..24117da61ad706840be77d247d045d14dc0127e4 100644
--- a/third_party/WebKit/Source/platform/heap/HeapTest.cpp
+++ b/third_party/WebKit/Source/platform/heap/HeapTest.cpp
@@ -1517,12 +1517,15 @@ class PreFinalizerBackingShrinkForbidden
}
void Dispose() {
- // Remove elemets so that vector_ will try to shrink.
- for (int i = 0; i < 32; ++i) {
+ // Remove all elemets except one so that vector_ will try to shrink.
+ for (int i = 1; i < 32; ++i) {
vector_.pop_back();
}
// Check that vector_ hasn't shrunk.
- EXPECT_LT(31ul, map_.Capacity());
+ EXPECT_LT(31ul, vector_.Capacity());
+ // Just releasing the backing is allowed.
+ vector_.Clear();
+ EXPECT_EQ(0ul, vector_.Capacity());
// Remove elemets so that map_ will try to shrink.
for (int i = 0; i < 32; ++i) {
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/wtf/Vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698