hello-world @MLton gc-summary fixed-heap 10k -- a b cIn the above example, CommandLine.arguments () = ["a", "b", "c"].
It is allowed to have a sequence of @MLton arguments, as in:
hello-world @MLton gc-summary -- @MLton fixed-heap 10k -- a b c
Run-time options can also control MLton, as in
mlton @MLton fixed-heap 0.5g -- foo.sml
Options
-
fixed-heap x{k|K|m|M|g|G}
-
gc-messages
-
gc-summary
-
load-world world
-
max-heap x{k|K|m|M|g|G}
-
no-load-world
-
ram-slop x
-
stop
-
Use a fixed size heap of size x, where x is a real number and the trailing letter indicates its units.
k or K | 1024 |
m or M | 1,048,576 |
g or G | 1,073,741,824 |
The heap size used by fixed-heap 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.
-
Print a message at the start and end of every garbage collection.
-
Print a summary of garbage collection statistics upon program termination.
-
Restart the computation with the file specified by world, which must have been created by a call to MLton.World.save by the same executable. See MLtonWorld.
-
Run the computation with an automatically resized heap that is never larger than x, where x is a real number and the trailing letter indicates the units as with fixed-heap. The heap size for max-heap is accounted for as with fixed-heap.
-
Disable load-world. This can be used as an argument to the compiler via -runtime no-load-world 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.
-
Multiply x by the amount of RAM on the machine to obtain what the runtime views as the amount of RAM it can use. Typically x is less than 1, and is used to account for space used by other programs running on the same machine.
-
Causes the runtime to stop processing @MLton arguments once the next -- is reached. This can be used as an argument to the compiler via -runtime stop to create executables that don't process any @MLton arguments.