aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-01-12 15:38:23 +0000
committergingerBill <bill@gingerbill.org>2023-01-12 15:38:23 +0000
commite97bf2ef358eef4499dfee0dc1533bf785d923f2 (patch)
tree39962e30c0faab08db88f93aa472b4958875925b /src/checker.cpp
parentd6c54148d93a649dbf8d75f97c5c487431b0c8fd (diff)
Minimize contention on the deps for decls
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index 6d73348d1..7be3c71d1 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -1256,6 +1256,7 @@ gb_internal void init_checker(Checker *c) {
// NOTE(bill): 1 Mi elements should be enough on average
array_init(&c->procs_to_check, heap_allocator(), 0, 1<<20);
+ array_init(&c->nested_proc_lits, heap_allocator(), 0, 1<<20);
mpsc_init(&c->global_untyped_queue, a); // , 1<<20);
@@ -1267,6 +1268,7 @@ gb_internal void destroy_checker(Checker *c) {
destroy_checker_context(&c->builtin_ctx);
+ array_free(&c->nested_proc_lits);
array_free(&c->procs_to_check);
mpsc_destroy(&c->global_untyped_queue);
}
@@ -5657,6 +5659,11 @@ gb_internal void check_walk_all_dependencies(DeclInfo *decl) {
}
gb_internal void check_update_dependency_tree_for_procedures(Checker *c) {
+ mutex_lock(&c->nested_proc_lits_mutex);
+ for (DeclInfo *decl : c->nested_proc_lits) {
+ check_walk_all_dependencies(decl);
+ }
+ mutex_unlock(&c->nested_proc_lits_mutex);
for (Entity *e : c->info.entities) {
DeclInfo *decl = e->decl_info;
check_walk_all_dependencies(decl);