Commit ced0d752 authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot

rts: Enforce that mark-region isn't used with -h

As noted in #9666, the mark-region GC is not compatible with heap
profiling. Also add documentation for this flag.

Closes #9666.
parent 30f7137d
Pipeline #29605 failed with stages
in 631 minutes and 2 seconds
......@@ -411,6 +411,17 @@ performance.
Note that :rts-flag:`--nonmoving-gc` cannot be used with ``-G1``,
:rts-flag:`profiling <-hc>` nor :rts-flag:`-c`.
.. rts-flag:: -w
:default: off
:since: a long time ago
:reverse: none
Uses a mark-region garbage collection strategy for the oldest-generation heap.
Note that this cannot be used in conjunction with heap profiling
(:rts-flag:`-hT`) unless linked against the profiling runtime system with
:ghc-flag:`-prof`.
.. rts-flag:: -xn
:default: off
......
......@@ -1850,6 +1850,16 @@ static void normaliseRtsOpts (void)
barf("The non-moving collector doesn't support -G1");
}
#if !defined(PROFILING) && !defined(DEBUG)
// The mark-region collector is incompatible with heap census unless
// we zero slop of blackhole'd thunks, which doesn't happen in the
// vanilla way. See #9666.
if (RtsFlags.ProfFlags.doHeapProfile && RtsFlags.GcFlags.sweep) {
barf("The mark-region collector can only be used with profiling\n"
"when linked against the profiled RTS.");
}
#endif
if (RtsFlags.ProfFlags.doHeapProfile != NO_HEAP_PROFILING &&
RtsFlags.GcFlags.useNonmoving) {
barf("The non-moving collector doesn't support profiling");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment