5 #ifndef INCLUDE_CPPGC_INTERNAL_PERSISTENT_NODE_H_
6 #define INCLUDE_CPPGC_INTERNAL_PERSISTENT_NODE_H_
12 #include "cppgc/internal/logging.h"
13 #include "cppgc/trace-trait.h"
25 class PersistentNode
final {
30 PersistentNode&
operator=(
const PersistentNode&) =
delete;
54 trace_(visitor, owner_);
57 bool IsUsed()
const {
return trace_; }
72 TraceCallback trace_ =
nullptr;
76 using PersistentNodeSlots = std::array<PersistentNode, 256u>;
84 PersistentRegion&
operator=(
const PersistentRegion&) =
delete;
87 if (!free_list_head_) {
90 PersistentNode* node = free_list_head_;
98 free_list_head_ = node;
106 void EnsureNodeSlots();
108 std::vector<std::unique_ptr<PersistentNodeSlots>> nodes_;
109 PersistentNode* free_list_head_ =
nullptr;