Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: runtime/vm/gc_sweeper.h

Issue 468913011: - Address code review comment from https://codereview.chromium.org/488943002/ (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_GC_SWEEPER_H_ 5 #ifndef VM_GC_SWEEPER_H_
6 #define VM_GC_SWEEPER_H_ 6 #define VM_GC_SWEEPER_H_
7 7
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 9
10 namespace dart { 10 namespace dart {
11 11
12 // Forward declarations. 12 // Forward declarations.
13 class FreeList; 13 class FreeList;
14 class Heap; 14 class Heap;
15 class HeapPage; 15 class HeapPage;
16 16
17 // The class GCSweeper is used to visit the heap after marking to reclaim unused 17 // The class GCSweeper is used to visit the heap after marking to reclaim unused
18 // memory. 18 // memory.
19 class GCSweeper { 19 class GCSweeper {
20 public: 20 public:
21 explicit GCSweeper(Heap* heap) : heap_(heap) {} 21 explicit GCSweeper(Heap* heap) : heap_(heap) {}
22 ~GCSweeper() {} 22 ~GCSweeper() {}
23 23
24 // Sweep the memory area for the page while clearing the mark bits and adding 24 // Sweep the memory area for the page while clearing the mark bits and adding
25 // all the unmarked objects to the freelist. 25 // all the unmarked objects to the pre-locked freelist.
26 // Returns true if the page is in use. 26 // Returns true if the page is in use.
27 bool SweepPage(HeapPage* page, FreeList* freelist); 27 bool SweepPage(HeapPage* page, FreeList* freelist);
28 28
29 // Returns the number of words from page->object_start() to the end of the 29 // Returns the number of words from page->object_start() to the end of the
30 // last marked object. 30 // last marked object.
31 intptr_t SweepLargePage(HeapPage* page); 31 intptr_t SweepLargePage(HeapPage* page);
32 32
33 private: 33 private:
34 Heap* heap_; 34 Heap* heap_;
35 35
36 DISALLOW_IMPLICIT_CONSTRUCTORS(GCSweeper); 36 DISALLOW_IMPLICIT_CONSTRUCTORS(GCSweeper);
37 }; 37 };
38 38
39 } // namespace dart 39 } // namespace dart
40 40
41 #endif // VM_GC_SWEEPER_H_ 41 #endif // VM_GC_SWEEPER_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698