summaryrefslogtreecommitdiff
path: root/docs/users_guide/runtime_control.xml
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-11-16 15:40:40 +0000
committerSimon Marlow <marlowsd@gmail.com>2011-11-16 15:40:40 +0000
commitbea3992c71be47db7f2fc53f3e358212d1539706 (patch)
tree9ae1639c831a5be16161d4bf758c030bb3d92f5e /docs/users_guide/runtime_control.xml
parent1bbb89f3ab009367fcca84b73b351ddcf5be16a4 (diff)
downloadhaskell-bea3992c71be47db7f2fc53f3e358212d1539706.tar.gz
Doc changes following changes to the way -rtsopts works
Mainly, -rtsopts doesn't work with -no-hs-main, and you have to do something in your main() to get the effect of -rtsopts (and -with-rtsopts).
Diffstat (limited to 'docs/users_guide/runtime_control.xml')
-rw-r--r--docs/users_guide/runtime_control.xml37
1 files changed, 7 insertions, 30 deletions
diff --git a/docs/users_guide/runtime_control.xml b/docs/users_guide/runtime_control.xml
index 20aca07cd3..57e89c7151 100644
--- a/docs/users_guide/runtime_control.xml
+++ b/docs/users_guide/runtime_control.xml
@@ -135,8 +135,10 @@ $ ./prog -f +RTS -H32m -S -RTS -h foo bar
<para>
GHC lets you change the default RTS options for a program at
compile time, using the <literal>-with-rtsopts</literal>
- flag (<xref linkend="options-linker" />). For example, to
- set <literal>-H128m -K64m</literal>, link
+ flag (<xref linkend="options-linker" />). A common use for this is
+ to give your program a default heap and/or stack size that is
+ greater than the default. For example, to set <literal>-H128m
+ -K64m</literal>, link
with <literal>-with-rtsopts="-H128m -K64m"</literal>.
</para>
</sect3>
@@ -187,37 +189,17 @@ $ ./prog -f +RTS -H32m -S -RTS -h foo bar
<indexterm><primary>RTS hooks</primary></indexterm>
<indexterm><primary>RTS behaviour, changing</primary></indexterm>
- <para>GHC lets you exercise rudimentary control over the RTS
+ <para>GHC lets you exercise rudimentary control over certain RTS
settings for any given program, by compiling in a
&ldquo;hook&rdquo; that is called by the run-time system. The RTS
- contains stub definitions for all these hooks, but by writing your
+ contains stub definitions for these hooks, but by writing your
own version and linking it on the GHC command line, you can
override the defaults.</para>
<para>Owing to the vagaries of DLL linking, these hooks don't work
under Windows when the program is built dynamically.</para>
- <para>The hook <literal>ghc_rts_opts</literal><indexterm><primary><literal>ghc_rts_opts</literal></primary>
- </indexterm>lets you set RTS
- options permanently for a given program, in the same way as the
- newer <option>-with-rtsopts</option> linker option does. A common use for this is
- to give your program a default heap and/or stack size that is
- greater than the default. For example, to set <literal>-H128m
- -K1m</literal>, place the following definition in a C source
- file:</para>
-
-<programlisting>
-char *ghc_rts_opts = "-H128m -K1m";
-</programlisting>
-
- <para>Compile the C file, and include the object file on the
- command line when you link your Haskell program.</para>
-
- <para>These flags are interpreted first, before any RTS flags from
- the <literal>GHCRTS</literal> environment variable and any flags
- on the command line.</para>
-
- <para>You can also change the messages printed when the runtime
+ <para>You can change the messages printed when the runtime
system &ldquo;blows up,&rdquo; e.g., on stack overflow. The hooks
for these are as follows:</para>
@@ -254,11 +236,6 @@ char *ghc_rts_opts = "-H128m -K1m";
</listitem>
</varlistentry>
</variablelist>
-
- <para>For examples of the use of these hooks, see GHC's own
- versions in the file
- <filename>ghc/compiler/parser/hschooks.c</filename> in a GHC
- source tree.</para>
</sect3>
</sect2>