[Haskell-cafe] Re: Top Level <-
ashley at semantic.org
Sat Sep 6 18:25:44 EDT 2008
On Sat, 2008-09-06 at 18:16 -0400, Brandon S. Allbery KF8NH wrote:
> I have no idea what Ganesh is complaining about, but if the point of
> ACIO is one-time initialization, it is pretty much required that
> something will be allocated to record the fact that a given item has
> been initialized (otherwise it can't guarantee the initializer runs
> exactly once, after all), and therefore that is part of the base ACIO
> API. So what exactly is the issue here?
The issue is this:
1. Results from initialisers cannot be GC'd even if they become
otherwise unreachable, because the dynamic loader might re-load the
module (and then we'd need those original results).
2. If the dynamic loader loads an endless stream of different modules
containing initialisers, memory will thus leak.
It's tempting to say "don't do that" to point #2.
More information about the Haskell-Cafe