Why do we put GMP allocations on GHC heaps?

Bryan O'Sullivan bos at serpentine.com
Wed Oct 23 16:08:21 UTC 2013


On Wed, Oct 23, 2013 at 4:31 AM, Gergely Risko <gergely at risko.hu> wrote:

> I can understand that this may be slower in CPU, but can you please
> elaborate why would it be worse in memory, how the frees wouldn't happen
> in a "timely manner"?  I thought finalisers are called when the
> referencee is GCd, so if we free the mpz in the callback, then where are
> we going wrong?
>

There is no guarantee that finalizers will be called at all, much less that
they will be called in a timely manner. This is a general and well-known
property of all garbage collectors, not something unique to GHC.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20131023/de21b4d4/attachment.html>


More information about the ghc-devs mailing list