diff options
| author | gingerBill <bill@gingerbill.org> | 2023-01-03 14:45:09 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-01-03 14:45:09 +0000 |
| commit | 0fb3032b731b640a2d0d1d62b9f8dd548e224b0e (patch) | |
| tree | 178b8cc6c72684d7f0b0041af2b5616804b31638 /src/parser.cpp | |
| parent | 69934c3b0b1b8ad0a499574c39c1ab177a1fe30a (diff) | |
General improves to `alloc_ast_node` and other unnecessary checks
Diffstat (limited to 'src/parser.cpp')
| -rw-r--r-- | src/parser.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index 046469c16..c6f35d326 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -64,11 +64,9 @@ gb_global std::atomic<isize> global_total_node_memory_allocated; // NOTE(bill): And this below is why is I/we need a new language! Discriminated unions are a pain in C/C++ gb_internal Ast *alloc_ast_node(AstFile *f, AstKind kind) { - gbAllocator a = ast_allocator(f); - isize size = ast_node_size(kind); - Ast *node = cast(Ast *)gb_alloc(a, size); + Ast *node = cast(Ast *)arena_alloc(&global_thread_local_ast_arena, size, 16); node->kind = kind; node->file_id = f ? f->id : 0; |