diff --git a/src/igc.c b/src/igc.c index f154a040a0e..be2b9fb719e 100644 --- a/src/igc.c +++ b/src/igc.c @@ -4820,6 +4820,16 @@ igc_busy_p (void) return mps_arena_busy (global_igc->arena); } +static void * +igc_thread_fun (void *addr) +{ + while (true) + { + usleep (5000); + igc_collect (); + } +} + /*********************************************************************** Init ***********************************************************************/ @@ -4830,6 +4840,8 @@ init_igc (void) mps_lib_assert_fail_install (igc_assert_fail); global_igc = make_igc (); add_main_thread (); + pthread_t thr; + pthread_create (&thr, NULL, igc_thread_fun, global_igc); set_state (IGC_STATE_USABLE_PARKED); }