Chromium Code Reviews| Index: runtime/vm/pages.cc |
| diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc |
| index 24846526ea75a43a2a1ee3d4bed777410d137193..6e00090cbfbcbbe616f37de64b9e0da0ccecce2a 100644 |
| --- a/runtime/vm/pages.cc |
| +++ b/runtime/vm/pages.cc |
| @@ -169,6 +169,8 @@ PageSpace::PageSpace(Heap* heap, |
| FLAG_old_gen_growth_time_ratio), |
| gc_time_micros_(0), |
| collections_(0) { |
| + // We aren't holding the lock but no one can reference us yet. |
| + UpdateMaxCapacityLocked(); |
| } |
| @@ -532,6 +534,15 @@ void PageSpace::AbandonBumpAllocation() { |
| } |
| +void PageSpace::UpdateMaxCapacityLocked() { |
| + ASSERT(heap_ != NULL); |
| + ASSERT(heap_->isolate() != NULL); |
| + Isolate* isolate = heap_->isolate(); |
| + isolate->GetHeapOldCapacityMaxMetric()->SetValue( |
| + usage_.capacity_in_words * kWordSize); |
|
koda
2015/10/06 00:11:10
This could overflow on 32-bit with a >2 GB heap (c
Cutch
2015/10/06 14:03:53
Done.
|
| +} |
| + |
| + |
| bool PageSpace::Contains(uword addr) const { |
| for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) { |
| if (it.page()->Contains(addr)) { |