| 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; }
|
|
|