Change the implementation of Arena to use virtual memory, and remove the old gbArena code

This commit is contained in:
gingerBill
2021-08-26 15:38:34 +01:00
parent 98dd59e412
commit aa8777ee47
9 changed files with 424 additions and 1053 deletions
+2 -3
View File
@@ -95,7 +95,7 @@ struct AstFile {
AstPackage * pkg;
Scope * scope;
Arena arena;
Arena arena;
Ast * pkg_decl;
String fullpath;
@@ -741,11 +741,10 @@ gb_inline bool is_ast_when_stmt(Ast *node) {
return node->kind == Ast_WhenStmt;
}
gb_global Arena global_ast_arena = {};
gb_global gb_thread_local Arena global_ast_arena = {};
gbAllocator ast_allocator(AstFile *f) {
Arena *arena = f ? &f->arena : &global_ast_arena;
// Arena *arena = &global_ast_arena;
return arena_allocator(arena);
}