xo-interpreter2 stack: plumbing for aux_mm and use opportunistically

This commit is contained in:
Roland Conybeare 2026-02-15 14:13:38 -05:00
commit 78f1b8a0b6
8 changed files with 110 additions and 42 deletions

View file

@ -24,13 +24,14 @@ namespace xo {
namespace scm {
ParserStateMachine::ParserStateMachine(const ArenaConfig & config,
size_type max_stringtable_capacity,
obj<AAllocator> expr_alloc)
obj<AAllocator> expr_alloc,
obj<AAllocator> aux_alloc)
: stringtable_{max_stringtable_capacity},
parser_alloc_{DArena::map(config)},
expr_alloc_{expr_alloc},
aux_alloc_{aux_alloc},
debug_flag_{config.debug_flag_}
{
}
bool
@ -60,8 +61,8 @@ namespace xo {
stringtable_.visit_pools(visitor);
parser_alloc_.visit_pools(visitor);
// not counting expr_alloc_. We don't consider
// that to be owned by ParserStateMachine
// not counting {expr_alloc_, fixed_alloc_}. We don't consider
// either to be owned by ParserStateMachine
}
void

View file

@ -23,9 +23,10 @@ namespace xo {
SchematikaParser::SchematikaParser(const ArenaConfig & config,
size_t max_stringtable_capacity,
obj<AAllocator> expr_alloc,
obj<AAllocator> fixed_alloc,
bool debug_flag)
: psm_{config, max_stringtable_capacity, expr_alloc},
debug_flag_{debug_flag}
: psm_{config, max_stringtable_capacity, expr_alloc, fixed_alloc},
debug_flag_{debug_flag}
{
}

View file

@ -10,12 +10,14 @@ namespace xo {
namespace scm {
SchematikaReader::SchematikaReader(const ReaderConfig & config,
obj<AAllocator> expr_alloc)
obj<AAllocator> expr_alloc,
obj<AAllocator> fixed_alloc)
: tokenizer_{config.tk_buffer_config_,
config.tk_debug_flag_},
parser_{config.parser_arena_config_,
config.max_stringtable_cap_,
expr_alloc,
fixed_alloc,
config.parser_debug_flag_},
debug_flag_{config.reader_debug_flag_}
{