xo-reader2: + SyntaxStateMachine.forward_children method

Support gc traversal with goal of making ParserStateMachine a gc root
This commit is contained in:
Roland Conybeare 2026-03-24 17:43:45 -04:00
commit 41e1f06079

View file

@ -6,6 +6,7 @@
#include "Metatype.hpp"
#include "TypeVarRef.hpp"
#include <xo/reflect/Reflect.hpp>
#include <xo/alloc2/Collector.hpp>
#include <xo/facet/FacetRegistry.hpp>
namespace xo {
@ -89,10 +90,12 @@ namespace xo {
std::size_t
DTypeVarRef::forward_children(obj<ACollector> gc) noexcept
{
{
auto e = FacetRegistry::instance().variant<AGCObject,AType>(type_);
gc.forward_inplace(e.iface(), (void **)&type_.data_);
}
gc.forward_pivot_inplace(&type_);
//{
// auto e = FacetRegistry::instance().variant<AGCObject,AType>(type_);
// gc.forward_inplace(e.iface(), (void **)&type_.data_);
//}
return this->shallow_size();
}