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

Unified Diff: vm/gc_sweeper.h

Issue 8898034: - Implement the old sweeper. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vm/gc_marker.cc ('k') | vm/gc_sweeper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/gc_sweeper.h
===================================================================
--- vm/gc_sweeper.h (revision 0)
+++ vm/gc_sweeper.h (revision 0)
@@ -0,0 +1,39 @@
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#ifndef VM_GC_SWEEPER_H_
+#define VM_GC_SWEEPER_H_
+
+#include "vm/globals.h"
+
+namespace dart {
+
+// Forward declarations.
+class FreeList;
+class Heap;
+class HeapPage;
+
+// The class GCSweeper is used to visit the heap after marking to reclaim unused
+// memory.
+class GCSweeper {
+ public:
+ explicit GCSweeper(Heap* heap) : heap_(heap) {}
+ ~GCSweeper() {}
+
+ // Sweep the memory area for the page while clearing the mark bits and adding
+ // all the unmarked objects to the freelist.
+ // Returns the size of memory used by the marked objects.
+ intptr_t SweepPage(HeapPage* page, FreeList* freelist);
+
+ intptr_t SweepLargePage(HeapPage* page);
+
+ private:
+ Heap* heap_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(GCSweeper);
+};
+
+} // namespace dart
+
+#endif // VM_GC_SWEEPER_H_
« no previous file with comments | « vm/gc_marker.cc ('k') | vm/gc_sweeper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698