Skip to content

Commit 4864a1b

Browse files
authored
add an assertion to ensure we're not cleaning-up GC state for GC threads (#55233)
GC threads should never hit this branch.
1 parent 9b604c4 commit 4864a1b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/gc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3709,8 +3709,9 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection)
37093709
}
37103710
// free empty GC state for threads that have exited
37113711
if (jl_atomic_load_relaxed(&ptls2->current_task) == NULL) {
3712-
if (gc_is_parallel_collector_thread(t_i))
3713-
continue;
3712+
// GC threads should never exit
3713+
assert(!gc_is_parallel_collector_thread(t_i));
3714+
assert(!gc_is_concurrent_collector_thread(t_i));
37143715
jl_thread_heap_t *heap = &ptls2->gc_tls.heap;
37153716
if (heap->weak_refs.len == 0)
37163717
small_arraylist_free(&heap->weak_refs);

0 commit comments

Comments
 (0)