forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunmarker.h
More file actions
42 lines (32 loc) · 988 Bytes
/
Copy pathunmarker.h
File metadata and controls
42 lines (32 loc) · 988 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_HEAP_CPPGC_UNMARKER_H_
#define V8_HEAP_CPPGC_UNMARKER_H_
#include "src/heap/cppgc/heap-object-header.h"
#include "src/heap/cppgc/heap-visitor.h"
namespace cppgc {
namespace internal {
class SequentialUnmarker final : private HeapVisitor<SequentialUnmarker> {
friend class HeapVisitor<SequentialUnmarker>;
public:
explicit SequentialUnmarker(RawHeap& heap) { Traverse(heap); }
bool VisitNormalPage(NormalPage& page) {
page.ResetMarkedBytes();
return false;
}
bool VisitLargePage(LargePage& page) {
page.ResetMarkedBytes();
return false;
}
private:
bool VisitHeapObjectHeader(HeapObjectHeader& header) {
if (header.IsMarked()) {
header.Unmark();
}
return true;
}
};
} // namespace internal
} // namespace cppgc
#endif // V8_HEAP_CPPGC_UNMARKER_H_