diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-08-22 00:59:49 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-25 14:36:46 +0200 |
commit | d6f368a3f400fea3e89280262a8147e7ce5d855c (patch) | |
tree | 4eb64eb0d18dad1e40c70a5bff974fe8033fe389 /include/compiler.h | |
parent | df640dc7f55fef962b598562e10d8dd4d60fedc0 (diff) |
Move thread work from compiler/parser to thread_work file, fix use after free bug in multithreaded parser allocator
Diffstat (limited to 'include/compiler.h')
-rw-r--r-- | include/compiler.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/include/compiler.h b/include/compiler.h index 08b74b8..ac50d28 100644 --- a/include/compiler.h +++ b/include/compiler.h @@ -5,7 +5,7 @@ #include "std/buffer.h" #include "std/buffer_view.h" #include "std/arena_allocator.h" -#include "std/thread.h" +#include "std/thread_pool.h" #include "compiler_options.h" #include "ast.h" #include "program.h" @@ -49,20 +49,17 @@ struct amal_compiler { ArenaAllocator allocator; Scope root_scope; Buffer/*<Parser*>*/ parsers; - Buffer/*<FileScopeReference*>*/ queued_files; HashMapType(BufferView, FileScopeReference*) file_scopes; - ParserThreadData *threads; - int usable_thread_count; bool started; - bool work_failed; amal_mutex mutex; - int generic_work_object_index; + amal_thread_pool stage_task_thread_pool; }; void amal_compiler_options_init(amal_compiler_options *self); /* If @options is NULL, then default values are used. + @options are copied. You should run @amal_program_deinit even @amal_compiler_load_file fails, to cleanup memory. This function creates a copy of @filepath so it doesn't have to survive longer than this function call. The file has to be in utf-8 format and it can optionally have utf-8 BOM. |