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

Unified Diff: runtime/vm/object_test.cc

Issue 355123002: If a large object is truncated, also truncate the page. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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
Index: runtime/vm/object_test.cc
===================================================================
--- runtime/vm/object_test.cc (revision 37763)
+++ runtime/vm/object_test.cc (working copy)
@@ -2061,9 +2061,15 @@
value = Smi::New(i);
array.Add(value);
}
+ Heap* heap = Isolate::Current()->heap();
+ heap->CollectAllGarbage();
+ intptr_t capacity_before = heap->CapacityInWords(Heap::kOld);
new_array = Array::MakeArray(array);
EXPECT_EQ(1, new_array.Length());
- Isolate::Current()->heap()->CollectAllGarbage();
+ heap->CollectAllGarbage();
+ intptr_t capacity_after = heap->CapacityInWords(Heap::kOld);
+ // Page should shrink.
+ EXPECT_LT(capacity_after, capacity_before);
EXPECT_EQ(1, new_array.Length());
}

Powered by Google App Engine
This is Rietveld 408576698