| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_HEAP_H_ | 5 #ifndef VM_HEAP_H_ |
| 6 #define VM_HEAP_H_ | 6 #define VM_HEAP_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
| 10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 void CollectGarbage(Space space); | 120 void CollectGarbage(Space space); |
| 121 void CollectGarbage(Space space, ApiCallbacks api_callbacks, GCReason reason); | 121 void CollectGarbage(Space space, ApiCallbacks api_callbacks, GCReason reason); |
| 122 void CollectAllGarbage(); | 122 void CollectAllGarbage(); |
| 123 bool NeedsGarbageCollection() const { | 123 bool NeedsGarbageCollection() const { |
| 124 return old_space_.NeedsGarbageCollection(); | 124 return old_space_.NeedsGarbageCollection(); |
| 125 } | 125 } |
| 126 | 126 |
| 127 // Enables growth control on the page space heaps. This should be | 127 // Enables growth control on the page space heaps. This should be |
| 128 // called before any user code is executed. | 128 // called before any user code is executed. |
| 129 void InitGrowthControl(); |
| 129 void EnableGrowthControl() { SetGrowthControlState(true); } | 130 void EnableGrowthControl() { SetGrowthControlState(true); } |
| 130 void DisableGrowthControl() { SetGrowthControlState(false); } | 131 void DisableGrowthControl() { SetGrowthControlState(false); } |
| 131 void SetGrowthControlState(bool state); | 132 void SetGrowthControlState(bool state); |
| 132 bool GrowthControlState(); | 133 bool GrowthControlState(); |
| 133 | 134 |
| 134 // Protect access to the heap. Note: Code pages are made | 135 // Protect access to the heap. Note: Code pages are made |
| 135 // executable/non-executable when 'read_only' is true/false, respectively. | 136 // executable/non-executable when 'read_only' is true/false, respectively. |
| 136 void WriteProtect(bool read_only, bool include_code_pages); | 137 void WriteProtect(bool read_only, bool include_code_pages); |
| 137 void WriteProtectCode(bool read_only) { | 138 void WriteProtectCode(bool read_only) { |
| 138 old_space_.WriteProtectCode(read_only); | 139 old_space_.WriteProtectCode(read_only); |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 explicit WritableVMIsolateScope(Thread* thread, bool include_code_pages); | 390 explicit WritableVMIsolateScope(Thread* thread, bool include_code_pages); |
| 390 ~WritableVMIsolateScope(); | 391 ~WritableVMIsolateScope(); |
| 391 | 392 |
| 392 private: | 393 private: |
| 393 bool include_code_pages_; | 394 bool include_code_pages_; |
| 394 }; | 395 }; |
| 395 | 396 |
| 396 } // namespace dart | 397 } // namespace dart |
| 397 | 398 |
| 398 #endif // VM_HEAP_H_ | 399 #endif // VM_HEAP_H_ |
| OLD | NEW |