summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-06-01 16:50:45 -0400
committerBen Gamari <ben@well-typed.com>2020-07-15 23:55:23 -0400
commitb5991f01753f30cd8c72a74c87a1f1cbcef6a814 (patch)
treec5606c76d75ed0f162ad340583c32e7ce0467dc6
parentae11bdfd98a10266bfc7de9e16b500be220307ac (diff)
downloadhaskell-wip/T18281.tar.gz
rts: Add --copying-gc flag to reverse effect of --nonmoving-gcwip/T18281
Fixes #18281.
-rw-r--r--docs/users_guide/runtime_control.rst9
-rw-r--r--rts/RtsFlags.c11
2 files changed, 20 insertions, 0 deletions
diff --git a/docs/users_guide/runtime_control.rst b/docs/users_guide/runtime_control.rst
index 2ab493b71a..f27d5b255a 100644
--- a/docs/users_guide/runtime_control.rst
+++ b/docs/users_guide/runtime_control.rst
@@ -373,10 +373,19 @@ collection. Hopefully, you won't need any of these in normal operation,
but there are several things that can be tweaked for maximum
performance.
+.. rts-flag:: --copying-gc
+ :default: on
+ :since: 8.10.2
+ :reverse: --nonmoving-gc
+
+ Uses the generational copying garbage collector for all generations.
+ This is the default.
+
.. rts-flag:: --nonmoving-gc
:default: off
:since: 8.10.1
+ :reverse: --copying-gc
.. index::
single: concurrent mark and sweep
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index 6180f42e39..e1f64c58ab 100644
--- a/rts/RtsFlags.c
+++ b/rts/RtsFlags.c
@@ -292,6 +292,12 @@ usage_text[] = {
" -? Prints this message and exits; the program is not executed",
" --info Print information about the RTS used by this program",
"",
+" --nonmoving-gc",
+" Selects the non-moving mark-and-sweep garbage collector to",
+" manage the oldest generation.",
+" --copying-gc",
+" Selects the copying garbage collector to manage all generations.",
+"",
" -K<size> Sets the maximum stack size (default: 80% of the heap)",
" Egs: -K32k -K512k -K8M",
" -ki<size> Sets the initial thread stack size (default 1k) Egs: -ki4k -ki2m",
@@ -939,6 +945,11 @@ error = true;
printRtsInfo(rtsConfig);
stg_exit(0);
}
+ else if (strequal("copying-gc",
+ &rts_argv[arg][2])) {
+ OPTION_SAFE;
+ RtsFlags.GcFlags.useNonmoving = false;
+ }
else if (strequal("nonmoving-gc",
&rts_argv[arg][2])) {
OPTION_SAFE;