Chromium Code Reviews| Index: runtime/vm/pages.cc |
| =================================================================== |
| --- runtime/vm/pages.cc (revision 33235) |
| +++ runtime/vm/pages.cc (working copy) |
| @@ -126,6 +126,7 @@ |
| max_capacity_in_words_(max_capacity_in_words), |
| capacity_in_words_(0), |
| used_in_words_(0), |
| + external_allocated_in_words_(0), |
| sweeping_(false), |
| page_space_controller_(FLAG_heap_growth_space_ratio, |
| FLAG_heap_growth_rate, |
| @@ -272,6 +273,22 @@ |
| } |
| +void PageSpace::AllocateExternal(intptr_t size) { |
| + intptr_t size_in_words = size >> kWordSizeLog2; |
| + external_allocated_in_words_ += size_in_words; |
| + capacity_in_words_ += size_in_words; |
| + used_in_words_ += size_in_words; |
| +} |
| + |
| + |
| +void PageSpace::FreeExternal(intptr_t size) { |
| + intptr_t size_in_words = size >> kWordSizeLog2; |
| + external_allocated_in_words_ -= size_in_words; |
| + capacity_in_words_ -= size_in_words; |
| + used_in_words_ -= size_in_words; |
| +} |
| + |
| + |
| bool PageSpace::Contains(uword addr) const { |
| HeapPage* page = pages_; |
| while (page != NULL) { |
| @@ -541,6 +558,7 @@ |
| } |
| // Record data and print if requested. |
| + used_in_words += external_allocated_in_words_; |
|
Ivan Posva
2014/03/05 21:21:23
We probably want to track these separately in the
koda
2014/03/05 21:52:08
Done.
|
| intptr_t used_before_in_words = used_in_words_; |
| used_in_words_ = used_in_words; |