Chromium Code Reviews| Index: src/heap/gc-idle-time-handler.cc |
| diff --git a/src/heap/gc-idle-time-handler.cc b/src/heap/gc-idle-time-handler.cc |
| index 80417a7f25dcf81c20ebf6b8916f3855a82f5278..c2ece17d2ca177e6bddf01e552b77581cb365087 100644 |
| --- a/src/heap/gc-idle-time-handler.cc |
| +++ b/src/heap/gc-idle-time-handler.cc |
| @@ -132,8 +132,12 @@ bool GCIdleTimeHandler::ShouldDoScavenge( |
| static_cast<size_t>(new_space_size * kConservativeTimeRatio); |
| } else { |
| // We have to trigger scavenge before we reach the end of new space. |
| - new_space_allocation_limit -= |
| - new_space_allocation_throughput_in_bytes_per_ms * kMaxScheduledIdleTime; |
| + size_t adjust_limit = new_space_allocation_throughput_in_bytes_per_ms * |
| + kMaxScheduledIdleTime * 2; |
|
rmcilroy
2015/03/27 15:07:50
Pull out 'kMaxScheduledIdleTime * 2' as a variable
Hannes Payer (out of office)
2015/03/30 11:07:15
Done.
|
| + if (adjust_limit > new_space_allocation_limit) |
| + new_space_allocation_limit = 0; |
| + else |
| + new_space_allocation_limit -= adjust_limit; |
| } |
| if (scavenge_speed_in_bytes_per_ms == 0) { |