[MLton] Memory problems with latest CVS?
Stephen Weeks
MLton@mlton.org
Fri, 10 Sep 2004 10:37:20 -0700
> One is that you don't want to force a dependency on libgmp.so unless
> InfInf is actually used, and I don't know how to avoid that.
We used to have C code in {c,x86}-main.h that did an if test on
something in an attempt to do this. We could resurrect that,
and certainly do some cooperation between the basis library code, the
compiler, and the runtime to only call mp_set_memory_functions() if
we're using IntInf.
> The second is that the gmp gcd() code (even the lowest level) will
> call these allocation and freeing routines. This is also bad
> because it doesn't respect things like MLton setting the maximum
> heap size.
Yeah. I guess we could work around this by re-implementing gcd
completely in the SML. But, not clear that it's worth it (in fact,
probably not).
> Still, an improvement would be to test in an assert that the mpz
> routines return the original space, except for gcd.
OK. I'm off for the weekend, but will look into this when I get
back.