Use global arena for AstNode allocations

This commit is contained in:
gingerBill
2018-06-09 19:53:06 +01:00
parent 49ea9ed722
commit 268491b224
11 changed files with 129 additions and 120 deletions
+3 -2
View File
@@ -633,9 +633,9 @@ void remove_temp_files(String output_base) {
defer (array_free(&data));
isize n = output_base.len;
gb_memcopy(data.data, output_base.text, n);
gb_memmove(data.data, output_base.text, n);
#define EXT_REMOVE(s) do { \
gb_memcopy(data.data+n, s, gb_size_of(s)); \
gb_memmove(data.data+n, s, gb_size_of(s)); \
gb_file_remove(cast(char *)data.data); \
} while (0)
EXT_REMOVE(".ll");
@@ -718,6 +718,7 @@ int main(int arg_count, char **arg_ptr) {
init_string_buffer_memory();
init_global_error_collector();
arena_init(&global_ast_arena, heap_allocator());
array_init(&library_collections, heap_allocator());
// NOTE(bill): 'core' cannot be (re)defined by the user