refactor: 引入 Arena 内存池并优化指令分发,为类型系统重构做准备

This commit is contained in:
2026-03-08 15:59:55 +08:00
parent 91e4eb734e
commit 90448006ff
13 changed files with 301 additions and 36 deletions
+2 -1
View File
@@ -11,7 +11,7 @@ namespace Fig
{
Result<Program *, Error> Parser::Parse()
{
Program *program = new Program;
Program *program = arena.Allocate<Program>();
while (!isEOF)
{
auto result = parseStatement();
@@ -27,5 +27,6 @@ namespace Fig
program->nodes.push_back(stmt);
}
return program;
}
}; // namespace Fig