Skip to content

Commit

Permalink
runtime: force the garbage collector to run when a thread exits
Browse files Browse the repository at this point in the history
This is a first attempt to improve the memory usage reported in
issue justinethier#534.
  • Loading branch information
yorickhardy committed Nov 15, 2024
1 parent d8aa289 commit 955695f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -7181,6 +7181,7 @@ void Cyc_exit_thread(void *data, object _, int argc, object * args)
gc_remove_mutator(thd);
ck_pr_cas_int((int *)&(thd->thread_state), CYC_THREAD_STATE_RUNNABLE,
CYC_THREAD_STATE_TERMINATED);
gc_force();
pthread_exit(NULL);
}

Expand Down

0 comments on commit 955695f

Please sign in to comment.