aboutsummaryrefslogtreecommitdiff
path: root/src/tokenizer.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-08-26 23:10:15 +0100
committergingerBill <bill@gingerbill.org>2021-08-26 23:10:15 +0100
commitda79124e5d43c54a358fd18b64414ec2c1536476 (patch)
treecdf5d0379fb49cd209c903b4e17282c2bf8050e8 /src/tokenizer.cpp
parent2f34f1283a067335d5738abe15997e6af5e3a600 (diff)
Use local mutex for each `AstFile.arena`
Diffstat (limited to 'src/tokenizer.cpp')
-rw-r--r--src/tokenizer.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp
index 556da7c4c..814e418aa 100644
--- a/src/tokenizer.cpp
+++ b/src/tokenizer.cpp
@@ -805,8 +805,7 @@ void init_tokenizer_with_data(Tokenizer *t, String const &fullpath, void *data,
TokenizerInitError init_tokenizer_from_fullpath(Tokenizer *t, String const &fullpath, TokenizerFlags flags = TokenizerFlag_None) {
TokenizerInitError err = TokenizerInit_None;
- char *c_str = alloc_cstring(heap_allocator(), fullpath);
- defer (gb_free(heap_allocator(), c_str));
+ char *c_str = alloc_cstring(temporary_allocator(), fullpath);
// TODO(bill): Memory map rather than copy contents
gbFileContents fc = gb_file_read_contents(heap_allocator(), true, c_str);