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}
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.
-
gc-messages
Print a message at the start and end of every garbage collection. -
gc-summary
Print a summary of garbage collection statistics upon program termination. -
load-world world
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. -
max-heap x{k|K|m|M|g|G}
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. -
no-load-world
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. -
ram-slop x
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. -
stop
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.