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

Unified Diff: Source/platform/heap/Heap.cpp

Issue 1079993002: collectAllGarbage(): bail on reaching fixed point. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use markedObjectSize() Created 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Heap.cpp
diff --git a/Source/platform/heap/Heap.cpp b/Source/platform/heap/Heap.cpp
index 876a650425a80bc41f97a856b5a833eefbb6dbfd..16c67093890111d27448cde922ab3d20f9a7e54f 100644
--- a/Source/platform/heap/Heap.cpp
+++ b/Source/platform/heap/Heap.cpp
@@ -2396,8 +2396,14 @@ void Heap::collectAllGarbage()
// because the hierarchy was not completely moved to the heap and
// some heap allocated objects own objects that contain persistents
// pointing to other heap allocated objects.
- for (int i = 0; i < 5; ++i)
+ size_t previousLiveObjects = 0;
+ for (int i = 0; i < 5; ++i) {
collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::GCWithSweep, ForcedGCForTesting);
+ size_t liveObjects = Heap::markedObjectSize();
+ if (liveObjects == previousLiveObjects)
+ break;
+ previousLiveObjects = liveObjects;
+ }
}
double Heap::estimatedMarkingTime()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698