Chromium Code Reviews| Index: runtime/vm/pages.cc |
| =================================================================== |
| --- runtime/vm/pages.cc (revision 15570) |
| +++ runtime/vm/pages.cc (working copy) |
| @@ -228,7 +228,9 @@ |
| // On overflow we fail to allocate. |
| return 0; |
| } |
| - if (CanIncreaseCapacity(page_size)) { |
| + if ((page_space_controller_.CanGrowPageSpace(size) || |
| + growth_policy == kForceGrowth) && |
| + CanIncreaseCapacity(page_size)) { |
| HeapPage* page = AllocateLargePage(size, type); |
| if (page != NULL) { |
| result = page->object_start(); |
| @@ -568,16 +570,12 @@ |
| } |
| OS::PrintErr("\n"); |
| } |
| - if (!enough_free_space) { |
| - intptr_t growth_target = static_cast<intptr_t>(in_use_after / |
| - desired_utilization_); |
| - intptr_t growth_in_bytes = Utils::RoundUp(growth_target - in_use_after, |
| - PageSpace::kPageSize); |
| - int growth_in_pages = growth_in_bytes / PageSpace::kPageSize; |
| - grow_heap_ = Utils::Maximum(growth_in_pages, heap_growth_rate_); |
| - } else { |
| - grow_heap_ = heap_growth_rate_; |
| - } |
| + intptr_t growth_target = static_cast<intptr_t>(in_use_after / |
|
Ivan Posva
2012/11/30 18:32:27
This is a first step at cleaning up the policy. Th
|
| + desired_utilization_); |
| + intptr_t growth_in_bytes = Utils::RoundUp(growth_target - in_use_after, |
| + PageSpace::kPageSize); |
| + int growth_in_pages = growth_in_bytes / PageSpace::kPageSize; |
| + grow_heap_ = Utils::Maximum(growth_in_pages, heap_growth_rate_); |
| } |
| } |