[Haskell-cafe] Way to prevent a value from being garbage collected too early

Ben Gamari ben at smart-cactus.org
Wed May 13 12:41:40 UTC 2020


On May 13, 2020 5:00:08 AM EDT, Henning Thielemann <lemming at henning-thielemann.de> wrote:
>
>On Wed, 13 May 2020, Sylvain Henry wrote:
>
>> It's quite fragile (e.g. can be optimized away or moved), so we're
>trying to replace it with something else. See
>> https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/with-combinator
>
>I remember that the fragility due to optimization is quite a problem. I
>
>found that creating a StablePtr is reliable, however.
>_______________________________________________
>Haskell-Cafe mailing list
>To (un)subscribe, modify options or view archives go to:
>http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>Only members subscribed via the mailman list are allowed to post.

Yes, but do note that the latter of significantly more expensive. 

Cheers,

— Ben


More information about the Haskell-Cafe mailing list