MLton MLTONWIKIVERSION

GnuMP

Home Index

The GnuMP (GNU multiprecision library) is a library for arbitrary precision integer arithmetic. MLton uses the GnuMP to implement the Basis Library `IntInf` module.

There is a known problem with the GnuMP, where it requires a lot of stack space for some computations, e.g. `IntInf.toString` of a million digit number. If you run with stack size limited, you may see a segfault in such programs. This problem is mentioned in the GnuMP FAQ, where they describe two solutions.

- Increase (or unlimit) your stack space. From your program, use `setrlimit`, or from the shell, use `ulimit`.

- Configure and rebuild `libgmp` with `--disable-alloca`, which will cause it to allocate temporaries using `malloc` instead of on the stack.

Last edited on 2007-08-15 22:06:35 by MatthewFluet.