diff options
| author | gingerBill <bill@gingerbill.org> | 2021-09-13 01:30:30 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-09-13 01:30:30 +0100 |
| commit | 042dbda47f8a428c1be2b1af2937f0cbff109c11 (patch) | |
| tree | 9185639a96d96da650ab290961531036f6ec4e8c /src/tokenizer.cpp | |
| parent | 2d7aea79b94721362f4fc5285c2a99ab37f52a58 (diff) | |
Replace many uses of `heap_allocator()` with `permanent_allocator()`
Diffstat (limited to 'src/tokenizer.cpp')
| -rw-r--r-- | src/tokenizer.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp index 237179ca5..35d6775a3 100644 --- a/src/tokenizer.cpp +++ b/src/tokenizer.cpp @@ -371,7 +371,7 @@ void begin_error_block(void) { void end_error_block(void) { if (global_error_collector.error_buffer.count > 0) { isize n = global_error_collector.error_buffer.count; - u8 *text = gb_alloc_array(heap_allocator(), u8, n+1); + u8 *text = gb_alloc_array(permanent_allocator(), u8, n+1); gb_memmove(text, global_error_collector.error_buffer.data, n); text[n] = 0; String s = {text, n}; @@ -404,7 +404,7 @@ ERROR_OUT_PROC(default_error_out_va) { } else { mutex_lock(&global_error_collector.error_out_mutex); { - u8 *text = gb_alloc_array(heap_allocator(), u8, n+1); + u8 *text = gb_alloc_array(permanent_allocator(), u8, n+1); gb_memmove(text, buf, n); text[n] = 0; array_add(&global_error_collector.errors, make_string(text, n)); @@ -838,12 +838,6 @@ TokenizerInitError init_tokenizer_from_fullpath(Tokenizer *t, String const &full return err; } -gb_inline void destroy_tokenizer(Tokenizer *t) { - if (t->start != nullptr) { - gb_free(heap_allocator(), t->start); - } -} - gb_inline i32 digit_value(Rune r) { switch (r) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': |