OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 #ifndef SRC_VM_MARK_SWEEP_H_ | 5 #ifndef SRC_VM_MARK_SWEEP_H_ |
6 #define SRC_VM_MARK_SWEEP_H_ | 6 #define SRC_VM_MARK_SWEEP_H_ |
7 | 7 |
8 #include "src/vm/object.h" | 8 #include "src/vm/object.h" |
9 #include "src/vm/program.h" | 9 #include "src/vm/program.h" |
10 #include "src/vm/process.h" | 10 #include "src/vm/process.h" |
11 | 11 |
12 namespace fletch { | 12 namespace dartino { |
13 | 13 |
14 class MarkingStackChunk { | 14 class MarkingStackChunk { |
15 public: | 15 public: |
16 MarkingStackChunk() | 16 MarkingStackChunk() |
17 : next_chunk_(NULL), next_(&backing_[0]), limit_(next_ + kChunkSize) {} | 17 : next_chunk_(NULL), next_(&backing_[0]), limit_(next_ + kChunkSize) {} |
18 | 18 |
19 ~MarkingStackChunk() { ASSERT(next_chunk_ == NULL); } | 19 ~MarkingStackChunk() { ASSERT(next_chunk_ == NULL); } |
20 | 20 |
21 bool IsEmpty() { return next_ == &backing_[0]; } | 21 bool IsEmpty() { return next_ == &backing_[0]; } |
22 | 22 |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 virtual void ChunkEnd(uword end) { AddFreeListChunk(end); } | 287 virtual void ChunkEnd(uword end) { AddFreeListChunk(end); } |
288 | 288 |
289 int used() const { return used_; } | 289 int used() const { return used_; } |
290 | 290 |
291 private: | 291 private: |
292 FreeList* free_list_; | 292 FreeList* free_list_; |
293 uword free_start_; | 293 uword free_start_; |
294 int used_; | 294 int used_; |
295 }; | 295 }; |
296 | 296 |
297 } // namespace fletch | 297 } // namespace dartino |
298 | 298 |
299 #endif // SRC_VM_MARK_SWEEP_H_ | 299 #endif // SRC_VM_MARK_SWEEP_H_ |
OLD | NEW |