Chromium Code Reviews| 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/virtual_memory.h" | 10 #include "vm/virtual_memory.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 static const intptr_t kAllocatablePageSize = kPageSize - sizeof(HeapPage); | 98 static const intptr_t kAllocatablePageSize = kPageSize - sizeof(HeapPage); |
| 99 | 99 |
| 100 void AllocatePage(); | 100 void AllocatePage(); |
| 101 HeapPage* AllocateLargePage(intptr_t size); | 101 HeapPage* AllocateLargePage(intptr_t size); |
| 102 void FreeLargePage(HeapPage* page, HeapPage* previous_page); | 102 void FreeLargePage(HeapPage* page, HeapPage* previous_page); |
| 103 void FreePages(HeapPage* pages); | 103 void FreePages(HeapPage* pages); |
| 104 | 104 |
| 105 static intptr_t LargePageSizeFor(intptr_t size); | 105 static intptr_t LargePageSizeFor(intptr_t size); |
| 106 bool CanIncreaseCapacity(intptr_t increase) { | 106 bool CanIncreaseCapacity(intptr_t increase) { |
|
siva
2011/12/22 23:48:38
Why did you remove the assert why not change to:
A
Ivan Posva
2011/12/23 00:12:06
Assertion adjusted.
| |
| 107 ASSERT(capacity_ < max_capacity_); | |
| 108 return increase <= (max_capacity_ - capacity_); | 107 return increase <= (max_capacity_ - capacity_); |
| 109 } | 108 } |
| 110 | 109 |
| 111 uword TryBumpAllocate(intptr_t size); | 110 uword TryBumpAllocate(intptr_t size); |
| 112 | 111 |
| 113 FreeList freelist_; | 112 FreeList freelist_; |
| 114 | 113 |
| 115 Heap* heap_; | 114 Heap* heap_; |
| 116 | 115 |
| 117 HeapPage* pages_; | 116 HeapPage* pages_; |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 130 | 129 |
| 131 // Keep track whether a MarkSweep is currently running. | 130 // Keep track whether a MarkSweep is currently running. |
| 132 bool sweeping_; | 131 bool sweeping_; |
| 133 | 132 |
| 134 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); | 133 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); |
| 135 }; | 134 }; |
| 136 | 135 |
| 137 } // namespace dart | 136 } // namespace dart |
| 138 | 137 |
| 139 #endif // VM_PAGES_H_ | 138 #endif // VM_PAGES_H_ |
| OLD | NEW |