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

Unified Diff: runtime/vm/pages.h

Issue 313393003: Changes to improve the performance of reading a snapshot. (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/pages.h
===================================================================
--- runtime/vm/pages.h (revision 37116)
+++ runtime/vm/pages.h (working copy)
@@ -125,7 +125,7 @@
// Returns whether growing to 'after' should trigger a GC.
// This method can be called before allocation (e.g., pretenuring) or after
// (e.g., promotion), as it does not change the state of the controller.
- bool NeedsGarbageCollection(SpaceUsage after) const;
+ bool NeedsGarbageCollection(intptr_t after_capacity_in_words) const;
// Should be called after each collection to update the controller state.
void EvaluateGarbageCollection(SpaceUsage before,
@@ -202,8 +202,9 @@
GrowthPolicy growth_policy = kControlGrowth);
bool NeedsGarbageCollection() const {
- return page_space_controller_.NeedsGarbageCollection(usage_) ||
- NeedsExternalGC();
+ const bool needs_gc =
+ page_space_controller_.NeedsGarbageCollection(usage_.capacity_in_words);
+ return needs_gc || NeedsExternalGC();
}
intptr_t UsedInWords() const { return usage_.used_in_words; }
« no previous file with comments | « runtime/vm/datastream.h ('k') | runtime/vm/pages.cc » ('j') | runtime/vm/snapshot.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698