Skip to content

Commit

Permalink
add an assertion to ensure we're not cleaning-up GC state for GC thre…
Browse files Browse the repository at this point in the history
…ads (#55233)

GC threads should never hit this branch.
  • Loading branch information
d-netto authored Jul 25, 2024
1 parent 9b604c4 commit 4864a1b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3709,8 +3709,9 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection)
}
// free empty GC state for threads that have exited
if (jl_atomic_load_relaxed(&ptls2->current_task) == NULL) {
if (gc_is_parallel_collector_thread(t_i))
continue;
// GC threads should never exit
assert(!gc_is_parallel_collector_thread(t_i));
assert(!gc_is_concurrent_collector_thread(t_i));
jl_thread_heap_t *heap = &ptls2->gc_tls.heap;
if (heap->weak_refs.len == 0)
small_arraylist_free(&heap->weak_refs);
Expand Down

0 comments on commit 4864a1b

Please sign in to comment.