Why do we put GMP allocations on GHC heaps?

Gergely Risko gergely at risko.hu
Wed Oct 23 13:45:10 UTC 2013


On Tue, 22 Oct 2013 20:26:53 -0400, Edward Kmett <ekmett at gmail.com> writes:

> Not suggesting we actually switch, but there is one strong 'why': You
> can't link Haskell code with any library that uses GMP internally
> internally without switching to using integer-simple. I've been trying
> with very limited success to get good MPFR bindings for Haskell for ~3
> years now as a result.

Have you tried going the other-way around?  Modifying GMP+MPFR just a
little bit to ignore the mem_set_functions that are called by GHC and
force them to use malloc.  Then writing a wrapper for this patched
GMP+MPFR.

Gergely



More information about the ghc-devs mailing list