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_; }
67 TraceCallback trace_ =
nullptr;
71 using PersistentNodeSlots = std::array<PersistentNode, 256u>;
80 if (!free_list_head_) {
83 PersistentNode* node = free_list_head_;
91 free_list_head_ = node;
99 void EnsureNodeSlots();
101 std::vector<std::unique_ptr<PersistentNodeSlots>> nodes_;
102 PersistentNode* free_list_head_ =
nullptr;