summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-12-10 12:56:37 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-01-07 00:10:16 -0500
commitced0d7525f6a6c33610e43d91c559691952dae6d (patch)
tree39bb235eea09b25ef4f34f4e044977ceb242ab46
parent30f7137d1acc48499840d9a106ecce6109fd8e7a (diff)
downloadhaskell-ced0d7525f6a6c33610e43d91c559691952dae6d.tar.gz
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.
-rw-r--r--docs/users_guide/runtime_control.rst11
-rw-r--r--rts/RtsFlags.c10
2 files changed, 21 insertions, 0 deletions
diff --git a/docs/users_guide/runtime_control.rst b/docs/users_guide/runtime_control.rst
index 49dc6a5441..81357b9120 100644
--- a/docs/users_guide/runtime_control.rst
+++ b/docs/users_guide/runtime_control.rst
@@ -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
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index b0f3ac4475..95656c3da6 100644
--- a/rts/RtsFlags.c
+++ b/rts/RtsFlags.c
@@ -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");