refactor: + narrower interface for gc pointer forwarding

add AGCObjectVisitor, instead of requiring ACollector.
This commit is contained in:
Roland Conybeare 2026-04-05 23:53:02 -04:00
commit fdc3054c7c
46 changed files with 187 additions and 165 deletions

View file

@ -112,26 +112,18 @@ namespace xo {
// ----- gcobject facet -----
std::size_t
DLocalSymtab::shallow_size() const noexcept
{
return sizeof(DLocalSymtab);
}
DLocalSymtab *
DLocalSymtab::shallow_move(obj<ACollector> gc) noexcept
{
return gc.std_move_for(this);
}
std::size_t
DLocalSymtab::forward_children(obj<ACollector> gc) noexcept
void
DLocalSymtab::visit_gco_children(obj<AGCObjectVisitor> gc) noexcept
{
gc.forward_inplace(&parent_);
gc.forward_inplace(&vars_);
gc.forward_inplace(&types_);
return shallow_size();
gc.visit_child(&parent_);
gc.visit_child(&vars_);
gc.visit_child(&types_);
}
// ----- printable facet -----