diff options
author | Ben Gamari <ben@smart-cactus.org> | 2023-03-07 21:23:27 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-03-08 15:02:31 -0500 |
commit | f6f12a36346e19de7eed330537350d0b7420764a (patch) | |
tree | b87d2fb1285641c7580a7864d8b395f1ebd98452 /rts/Schedule.c | |
parent | a57f12b3f06afe29cbbc6eb0a887bcbe319f17f6 (diff) | |
download | haskell-f6f12a36346e19de7eed330537350d0b7420764a.tar.gz |
rts: Capture GC configuration in a struct
The number of distinct arguments passed to GarbageCollect was getting a
bit out of hand.
Diffstat (limited to 'rts/Schedule.c')
-rw-r--r-- | rts/Schedule.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c index 93c155515f..5c9f75859a 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -1873,14 +1873,22 @@ delete_threads_and_gc: // Do any remaining idle GC work from the previous GC doIdleGCWork(cap, true /* all of it */); + struct GcConfig config = { + .collect_gen = collect_gen, + .do_heap_census = heap_census, + .overflow_gc = is_overflow_gc, + .deadlock_detect = deadlock_detect, + }; + #if defined(THREADED_RTS) // reset pending_sync *before* GC, so that when the GC threads // emerge they don't immediately re-enter the GC. RELAXED_STORE(&pending_sync, 0); signalCondition(&sync_finished_cond); - GarbageCollect(collect_gen, heap_census, is_overflow_gc, deadlock_detect, gc_type, cap, idle_cap); + config.parallel = gc_type == SYNC_GC_PAR; + GarbageCollect(config, cap, idle_cap); #else - GarbageCollect(collect_gen, heap_census, is_overflow_gc, deadlock_detect, 0, cap, NULL); + GarbageCollect(config, cap, NULL); #endif // If we're shutting down, don't leave any idle GC work to do. |