aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-08-26 15:38:34 +0100
committergingerBill <bill@gingerbill.org>2021-08-26 15:38:34 +0100
commitaa8777ee47f503eb90d4e2225274d0d20a9b39a3 (patch)
tree1848951efd4e7452e5fc04376e21920718f44a76 /src/parser.cpp
parent98dd59e412314f089fc9558c5cf92a8a5df5213a (diff)
Change the implementation of `Arena` to use virtual memory, and remove the old gbArena code
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index 880e92273..a98259454 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -4784,9 +4784,8 @@ ParseFileError init_ast_file(AstFile *f, String fullpath, TokenPos *err_pos) {
isize const page_size = 4*1024;
isize block_size = 2*f->tokens.count*gb_size_of(Ast);
block_size = ((block_size + page_size-1)/page_size) * page_size;
- block_size = gb_clamp(block_size, page_size, ARENA_DEFAULT_BLOCK_SIZE);
-
- arena_init(&f->arena, heap_allocator(), block_size);
+ block_size = gb_clamp(block_size, page_size, DEFAULT_MINIMUM_BLOCK_SIZE);
+ f->arena.minimum_block_size = block_size;
array_init(&f->comments, heap_allocator(), 0, 0);