Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
sweeper.h
Go to the documentation of this 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
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_VM_HEAP_SWEEPER_H_
6#define RUNTIME_VM_HEAP_SWEEPER_H_
7
8#include "vm/globals.h"
9
10namespace dart {
11
12// Forward declarations.
13class FreeList;
14class Heap;
15class Page;
16class IsolateGroup;
17class PageSpace;
18
19// The class GCSweeper is used to visit the heap after marking to reclaim unused
20// memory.
21class GCSweeper {
22 public:
25
26 // Sweep the memory area for the page while clearing the mark bits and adding
27 // all the unmarked objects to the freelist. Whether the freelist is
28 // pre-locked is indicated by the locked parameter.
29 // Returns true if the page is in use. Freelist is untouched if page is not
30 // in use.
31 bool SweepPage(Page* page, FreeList* freelist);
32
33 // Returns the number of words from page->object_start() to the end of the
34 // last marked object.
35 intptr_t SweepLargePage(Page* page);
36
37 intptr_t SweepNewPage(Page* page);
38
39 // Sweep the large and regular sized data pages.
40 static void SweepConcurrent(IsolateGroup* isolate_group);
41};
42
43} // namespace dart
44
45#endif // RUNTIME_VM_HEAP_SWEEPER_H_
bool SweepPage(Page *page, FreeList *freelist)
Definition sweeper.cc:60
static void SweepConcurrent(IsolateGroup *isolate_group)
Definition sweeper.cc:213
intptr_t SweepNewPage(Page *page)
Definition sweeper.cc:18
intptr_t SweepLargePage(Page *page)
Definition sweeper.cc:137