IORefs and garbage collection

Tomasz Zielonka tomasz.zielonka at gmail.com
Wed Apr 19 06:45:42 EDT 2006


On Wed, Apr 19, 2006 at 01:56:25PM +0400, Bulat Ziganshin wrote:
> generational GC (at least one used in GHC) is better suited for
> "functional" (immutable) data. this conception by itself based on that
> new allocated data can contain references to old ones but not vice
> versa. minor GC algorithms scans only new data, if they don't contain
> any references to some data cell (in new data), then all the heap
> don't contain references to this cell and it can be freed. most of the
> data in "normal" Haskell program are immutable so this works fine.

But most of the data is also lazy, and laziness in GHC is implemented
with mutation. I wonder how does GHC's GC handle thunk update.

Best regards
Tomasz


More information about the Glasgow-haskell-users mailing list