mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
ac02635ba5
This commit introduces the core infrastructure for variable-sized AST nodes, designed to improve memory efficiency. The previous fixed-size nodes are replaced by nodes that can store data inline, such as strings and integers, reducing pointer indirection and memory overhead. Key changes include: - A generic variable-sized node header (`mrb_ast_var_header`). - A size-class-based memory allocation system for these nodes. - Implementation of variable-sized nodes for core types: symbols, strings, integers, and variables (lvar, gvar, ivar, cvar). - Integration into the parser and code generator, controlled by a feature flag. - Centralized and improved type-casting macros for AST nodes. Co-authored-by: Claude <noreply@anthropic.com>