File: RunTimeOptions

package info (click to toggle)
mlton 20061107-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 27,828 kB
  • ctags: 61,118
  • sloc: ansic: 11,446; makefile: 1,339; sh: 1,160; lisp: 900; pascal: 256; asm: 97
file content (203 lines) | stat: -rw-r--r-- 5,852 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta name="robots" content="index,nofollow">



<title>RunTimeOptions - MLton Standard ML Compiler (SML Compiler)</title>
<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="all" href="common.css">
<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="screen" href="screen.css">
<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="print" href="print.css">


<link rel="Start" href="Home">


</head>

<body lang="en" dir="ltr">

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-833377-1";
urchinTracker();
</script>
<table bgcolor = lightblue cellspacing = 0 style = "border: 0px;" width = 100%>
  <tr>
    <td style = "
		border: 0px;
		color: darkblue; 
		font-size: 150%;
		text-align: left;">
      <a class = mltona href="Home">MLton 20061025</a>
    <td style = "
		border: 0px;
		font-size: 150%;
		text-align: center;
		width: 50%;">
      RunTimeOptions
    <td style = "
		border: 0px;
		text-align: right;">
      <table cellspacing = 0 style = "border: 0px">
        <tr style = "vertical-align: middle;">
      </table>
  <tr style = "background-color: white;">
    <td colspan = 3
	style = "
		border: 0px;
		font-size:70%;
		text-align: right;">
      <a href = "Home">Home</a>
      &nbsp;<a href = "Index">Index</a>
      &nbsp;
</table>
<div id="content" lang="en" dir="ltr">
Executables produced by MLton take command line arguments that control the runtime system.  These arguments are optional, and occur before the executable's usual arguments.  To use these options, the first argument to the executable must be <tt>@MLton</tt>.  The optional arguments then follow, must be terminated by <tt>--</tt>, and are followed by any arguments to the program.  The optional arguments are <em>not</em> made available to the SML program via <tt>CommandLine.arguments</tt>.  For example, a valid call to <tt>hello-world</tt> is: 
<pre>hello-world @MLton gc-summary fixed-heap 10k -- a b c
</pre>In the above example,  <tt>CommandLine.arguments&nbsp;()&nbsp;=&nbsp;["a",&nbsp;"b",&nbsp;"c"]</tt>. <p>
It is allowed to have a sequence of <tt>@MLton</tt> arguments, as in: 
<pre>hello-world @MLton gc-summary -- @MLton fixed-heap 10k -- a b c
</pre>
</p>
<p>
Run-time options can also control MLton, as in 
<pre>mlton @MLton fixed-heap 0.5g -- foo.sml
</pre>
</p>
<h2 id="head-6bf5da9c080bee3a8142586c412aa39971137eee">Options</h2>

    <ul>

    <li>
<p>
 <tt>fixed-heap&nbsp;</tt><em>x</em><tt>{k|K|m|M|g|G}&nbsp;</tt> 
</p>
</li>

            <ul>

   Use a fixed size heap of size <em>x</em>, where <em>x</em> is a real number    and the trailing letter indicates its units. 
<div>
<table>
   <tr>
<td>
 <tt>k</tt> or <tt>K</tt> </td>
<td>
 1024 </td>
</tr>
   <tr>
<td>
 <tt>m</tt> or <tt>M</tt> </td>
<td>
 1,048,576 </td>
</tr>
   <tr>
<td>
 <tt>g</tt> or <tt>G</tt> </td>
<td>
 1,073,741,824 </td>
</tr>
</table>
</div>
   A value of <tt>0</tt> means to use almost all the RAM present on the    machine. <p>
   The heap size used by <tt>fixed-heap</tt> includes all memory    allocated by SML code, including memory for the stack (or stacks,    if there are multiple threads).  It does not, however, include any    memory used for code itself or memory used by C globals, the C    stack, or malloc. 
</p>

            </ul>


    <li class="gap">
<p>
 <tt>gc-messages</tt> 
</p>
</li>

            <ul>

   Print a message at the start and end of every garbage collection. 
            </ul>


    <li class="gap">
<p>
 <tt>gc-summary</tt> 
</p>
</li>

            <ul>

   Print a summary of garbage collection statistics upon program termination. 
            </ul>


    <li class="gap">
<p>
 <tt>load-world&nbsp;</tt><em>world</em> 
</p>
</li>

            <ul>

   Restart the computation with the file specified by <em>world</em>, which    must have been created by a call to <tt>MLton.World.save</tt> by the    same executable.  See <a href="MLtonWorld">MLtonWorld</a>. 
            </ul>


    <li class="gap">
<p>
 <tt>max-heap&nbsp;</tt><em>x</em><tt>{k|K|m|M|g|G}&nbsp;</tt> 
</p>
</li>

            <ul>

   Run the computation with an automatically resized heap that is    never larger than <em>x</em>, where <em>x</em> is a real number and the    trailing letter indicates the units as with <tt>fixed-heap</tt>.  The    heap size for <tt>max-heap</tt> is accounted for as with    <tt>fixed-heap</tt>. 
            </ul>


    <li class="gap">
<p>
 <tt>no-load-world</tt> 
</p>
</li>

            <ul>

   Disable <tt>load-world</tt>.  This can be used as an argument to the    compiler via <tt>-runtime&nbsp;no-load-world</tt> to create executables    that will not load a world.  This may be useful to ensure that    set-uid executables do not load some strange world. 
            </ul>


    <li class="gap">
<p>
 <tt>ram-slop&nbsp;</tt><em>x</em> 
</p>
</li>

            <ul>

   Multiply <em>x</em> by the amount of RAM on the machine to obtain what    the runtime views as the amount of RAM it can use.  Typically    <em>x</em> is less than 1, and is used to account for space used by    other programs running on the same machine. 
            </ul>


    <li class="gap">
<p>
 <tt>stop</tt> 
</p>
</li>

            <ul>

   Causes the runtime to stop processing <tt>@MLton</tt> arguments once    the next <tt>--</tt> is reached.  This can be used as an argument to    the compiler via <tt>-runtime&nbsp;stop</tt> to create executables that don't    process any <tt>@MLton</tt> arguments. </ul>

</ul>

</div>



<p>
<hr>
Last edited on 2005-12-02 06:13:52 by <span title="ppp-71-139-183-221.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
</body></html>