[project @ 2005-03-09 08:51:31 by wolfgang]
authorwolfgang <unknown>
Wed, 9 Mar 2005 08:51:43 +0000 (08:51 +0000)
committerwolfgang <unknown>
Wed, 9 Mar 2005 08:51:43 +0000 (08:51 +0000)
commitabde5fdfcaa5f363d9cf8cf0a10aa281c40887fe
tree009162ce7ec855ee793941e88e148a5fec325171
parentf733edf2c30c837fac1726cdd1c7b0edeccd93a5
[project @ 2005-03-09 08:51:31 by wolfgang]
Retain all CAFs when dynamic Haskell libraries are used from GHCi.
The Linker usually replaces references to newCAF with references to newDynCAF,
but the system dynamic linker won't do that for us.

Also, the situation is slightly different - we never want CAFs from dylibs
to be reverted, because the dylibs might be used both by the interpreted
program and by GHCi itself.

So instead of just caf_list, there's now both caf_list and revertible_caf_list.
newDynCAF adds a CAF to revertible_caf_list, and newCAF either adds the CAF
to caf_list or to the mutable list, depending on whether we are in GHCi.

This hack is only active when Linker.c has loaded libHSbase_dyn.[so|dylib],
but for now, it applies to all CAFs, not just dynamically-linked ones.
If that is worth fixing, we could do that by checking whether the the CAF
closure or it's info pointer is in the main executable's address range.

MERGE TO STABLE
ghc/includes/Storage.h
ghc/rts/GC.c
ghc/rts/Linker.c
ghc/rts/Storage.c