Working on simplifying the allocation scheme

This commit is contained in:
Krzosa Karol
2023-01-01 10:48:06 +01:00
parent d10b72057e
commit 8c0a8bf72b
9 changed files with 126 additions and 98 deletions

View File

@@ -1,8 +1,9 @@
CORE_Static void
core_init_compiler(Parse_Ctx *ctx, Arena *perm, Allocator *heap) {
core_init_compiler(Core_Ctx *ctx, Arena *perm, Allocator *heap) {
ctx->init_ctx_time_begin = os_time();
pctx = ctx;
ctx->scratch = allocate_scratch_arena(perm, mib(1));
ctx->perm = perm;
ctx->heap = heap;
ctx->type_map = map_make(heap, 2048);
@@ -95,7 +96,7 @@ core_init_compiler(Parse_Ctx *ctx, Arena *perm, Allocator *heap) {
CORE_Static void
core_bootstrap_compiler(Allocator *allocator) {
Parse_Ctx *ctx = allocate_struct(allocator, Parse_Ctx);
Core_Ctx *ctx = allocate_struct(allocator, Core_Ctx);
assert((uintptr_t)allocator->allocate == (uintptr_t)arena_push_size);
core_init_compiler(ctx, (Arena *)allocator, allocator);