Skip to content

Commit

Permalink
bugfix when gc runs early
Browse files Browse the repository at this point in the history
  • Loading branch information
ncannasse committed Aug 27, 2023
1 parent 8d5c208 commit 3837f1e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,8 @@ static void gc_dispatch_mark( gc_mstack *st ) {
if( nthreads == 0 )
return;
int count = GC_STACK_COUNT(st) / (nthreads + 1);
if( count == 0 )
return;
for(i=0;i<gc_mark_threads;i++) {
gc_mthread *t = &mark_threads[i];
if( !atomic_bit_set(&mark_threads_active,1<<i) )
Expand Down Expand Up @@ -825,7 +827,7 @@ static void gc_mark() {
hl_semaphore_acquire(mark_threads_done);
for(i=0;i<gc_mark_threads;i++) {
gc_mthread *t = &mark_threads[i];
if( GC_STACK_COUNT(&t->stack) != 0 )
if( GC_STACK_COUNT(&t->stack) > 0 )
hl_fatal("assert");
}
}
Expand Down

0 comments on commit 3837f1e

Please sign in to comment.