Fixing printing / memory issues, Add stage arena, printing types in errors properly

This commit is contained in:
Krzosa Karol
2022-06-18 09:50:34 +02:00
parent f876b69779
commit 28f89def4b
3 changed files with 48 additions and 42 deletions

View File

@@ -179,6 +179,7 @@ Intern_String intern_flag;
struct Parse_Ctx:Lexer{
Allocator *perm; // Stores: AST, tokens, interns
Allocator *heap;
Arena stage_arena;
U64 type_ids;
U64 unique_ids; // @Debug
@@ -241,6 +242,7 @@ parse_init(Parse_Ctx *ctx, Allocator *perm_allocator, Allocator *heap_allocator)
ctx->ordered_decls = {ctx->heap};
ctx->type_map = {ctx->heap};
ctx->modules = {ctx->heap};
ctx->stage_arena = arena_sub(perm_allocator, mib(4), "Compiler stage arena"_s);
bigint_allocator = ctx->perm;
lex_init(ctx->perm, ctx->heap, ctx);