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 d740c94406
105 changed files with 260 additions and 416 deletions

View file

@ -59,7 +59,7 @@ namespace xo {
public:
using Super = DSyntaxStateMachine<DLambdaSsm>;
using DLocalSymtab = xo::scm::DLocalSymtab;
using ACollector = xo::mm::ACollector;
using AGCObjectVisitor = xo::mm::AGCObjectVisitor;
using AAllocator = xo::mm::AAllocator;
using DArena = xo::mm::DArena;
using TypeDescr = xo::reflect::TypeDescr;
@ -189,7 +189,7 @@ namespace xo {
///@{
/** gc support: visit gc-aware child pointers **/
void forward_children(obj<ACollector> gc) noexcept;
void visit_gco_children(obj<AGCObjectVisitor> gc) noexcept;
///@}

View file

@ -42,7 +42,7 @@ namespace xo {
/** @defgroup scm-syntaxstatemachine-dlambdassm-type-traits **/
///@{
using TypeDescr = xo::scm::ASyntaxStateMachine::TypeDescr;
using ACollector = xo::scm::ASyntaxStateMachine::ACollector;
using AGCObjectVisitor = xo::scm::ASyntaxStateMachine::AGCObjectVisitor;
using AGCObject = xo::scm::ASyntaxStateMachine::AGCObject;
using Copaque = xo::scm::ASyntaxStateMachine::Copaque;
using Opaque = xo::scm::ASyntaxStateMachine::Opaque;
@ -76,8 +76,8 @@ namespace xo {
static void on_parsed_expression_with_token(DLambdaSsm & self, obj<AExpression> expr, const Token & tk, ParserStateMachine * p_psm);
/** update state machine for nested quoted literal @p lit **/
static void on_quoted_literal(DLambdaSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm);
/** gc support: move immediate children to to-space and sub forwarding pointer **/
static void forward_children(DLambdaSsm & self, obj<ACollector> gc);
/** gc support: visit immediate gc-aware child pointers with @p gc. Call gc.visit_child() for each **/
static void visit_gco_children(DLambdaSsm & self, obj<AGCObjectVisitor> gc);
///@}
};