OLD | NEW |
---|---|
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_PAGES_H_ | 5 #ifndef VM_PAGES_H_ |
6 #define VM_PAGES_H_ | 6 #define VM_PAGES_H_ |
7 | 7 |
8 #include "vm/freelist.h" | 8 #include "vm/freelist.h" |
9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
10 #include "vm/lockers.h" | 10 #include "vm/lockers.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
227 MutexLocker ml(pages_lock_); | 227 MutexLocker ml(pages_lock_); |
228 IncreaseCapacityInWordsLocked(increase_in_words); | 228 IncreaseCapacityInWordsLocked(increase_in_words); |
229 } | 229 } |
230 void IncreaseCapacityInWordsLocked(intptr_t increase_in_words) { | 230 void IncreaseCapacityInWordsLocked(intptr_t increase_in_words) { |
231 DEBUG_ASSERT(pages_lock_->IsOwnedByCurrentThread()); | 231 DEBUG_ASSERT(pages_lock_->IsOwnedByCurrentThread()); |
232 usage_.capacity_in_words += increase_in_words; | 232 usage_.capacity_in_words += increase_in_words; |
233 UpdateMaxCapacityLocked(); | 233 UpdateMaxCapacityLocked(); |
234 } | 234 } |
235 | 235 |
236 void UpdateMaxCapacityLocked(); | 236 void UpdateMaxCapacityLocked(); |
237 void UpdateMaxUsed(); | |
238 void UpdateGlobalMaxUsed(); | |
koda
2015/10/06 18:09:02
General design comment: Why does the PageSpace/Sca
| |
237 | 239 |
238 intptr_t ExternalInWords() const { | 240 intptr_t ExternalInWords() const { |
239 return usage_.external_in_words; | 241 return usage_.external_in_words; |
240 } | 242 } |
241 SpaceUsage GetCurrentUsage() const { | 243 SpaceUsage GetCurrentUsage() const { |
242 MutexLocker ml(pages_lock_); | 244 MutexLocker ml(pages_lock_); |
243 return usage_; | 245 return usage_; |
244 } | 246 } |
245 | 247 |
246 bool Contains(uword addr) const; | 248 bool Contains(uword addr) const; |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
447 friend class HeapIterationScope; | 449 friend class HeapIterationScope; |
448 friend class PageSpaceController; | 450 friend class PageSpaceController; |
449 friend class SweeperTask; | 451 friend class SweeperTask; |
450 | 452 |
451 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); | 453 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); |
452 }; | 454 }; |
453 | 455 |
454 } // namespace dart | 456 } // namespace dart |
455 | 457 |
456 #endif // VM_PAGES_H_ | 458 #endif // VM_PAGES_H_ |
OLD | NEW |