Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 #ifndef VM_GC_SWEEPER_H_ | |
| 6 #define VM_GC_SWEEPER_H_ | |
| 7 | |
| 8 #include "vm/globals.h" | |
| 9 | |
| 10 namespace dart { | |
| 11 | |
| 12 // Forward declarations. | |
| 13 class FreeList; | |
| 14 class Heap; | |
| 15 class HeapPage; | |
| 16 | |
| 17 // The class GCSweeper is used to visit the heap after marking to reclaim unused | |
| 18 // memory. | |
| 19 class GCSweeper { | |
| 20 public: | |
| 21 explicit GCSweeper(Heap* heap) : heap_(heap) {} | |
| 22 ~GCSweeper() {} | |
| 23 | |
| 24 // Sweep the memory area for the page while clearing the mark bits and adding | |
| 25 // all the unmarked onbjects to the freelist. | |
|
siva
2011/12/14 16:20:13
*onbjects*objects
Ivan Posva
2011/12/15 22:29:19
Done.
| |
| 26 // Returns the size of memory used by the marked objects. | |
| 27 intptr_t SweepPage(HeapPage* page, FreeList* freelist); | |
| 28 | |
| 29 intptr_t SweepLargePage(HeapPage* page); | |
| 30 | |
| 31 private: | |
| 32 Heap* heap_; | |
|
siva
2011/12/14 16:20:13
DISALLOW_COPY_AND_ASSIGN
Ivan Posva
2011/12/15 22:29:19
DISALLOW_IMPLICIT_CONSTRUCTORS
| |
| 33 }; | |
| 34 | |
| 35 } // namespace dart | |
| 36 | |
| 37 #endif // VM_GC_SWEEPER_H_ | |
| OLD | NEW |