diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2025-09-10 19:30:32 +0100 |
|---|---|---|
| committer | gingerBill <gingerBill@users.noreply.github.com> | 2025-09-10 19:30:32 +0100 |
| commit | a36a8722dc823c6fe143f7935e79467c6569bc00 (patch) | |
| tree | 6dc0f7c0000150a7d4708b4384e785d4dd93cfea /src/check_expr.cpp | |
| parent | 21b1173076cec12f97c5779556509ef1b908c644 (diff) | |
Minimize more thread contention
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 84f1c6f0a..bdbccb4f8 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -7516,11 +7516,10 @@ gb_internal CallArgumentData check_call_arguments(CheckerContext *c, Operand *op return check_call_arguments_proc_group(c, operand, call); } - auto positional_operands = array_make<Operand>(heap_allocator(), 0, positional_args.count); - auto named_operands = array_make<Operand>(heap_allocator(), 0, 0); + TEMPORARY_ALLOCATOR_GUARD(); - defer (array_free(&positional_operands)); - defer (array_free(&named_operands)); + auto positional_operands = array_make<Operand>(temporary_allocator(), 0, positional_args.count); + auto named_operands = array_make<Operand>(temporary_allocator(), 0, 0); if (positional_args.count > 0) { Entity **lhs = nullptr; @@ -7623,11 +7622,10 @@ gb_internal CallArgumentError check_polymorphic_record_type(CheckerContext *c, O { // NOTE(bill, 2019-10-26): Allow a cycle in the parameters but not in the fields themselves auto prev_type_path = c->type_path; - c->type_path = new_checker_type_path(); - defer ({ - destroy_checker_type_path(c->type_path); - c->type_path = prev_type_path; - }); + TEMPORARY_ALLOCATOR_GUARD(); + + c->type_path = new_checker_type_path(temporary_allocator()); + defer (c->type_path = prev_type_path); if (is_call_expr_field_value(ce)) { named_fields = true; |