cvs commit: fptools/ghc/includes Storage.h fptools/ghc/rts GC.c
simonmar at microsoft.com
Wed Mar 9 05:27:48 EST 2005
On 09 March 2005 08:52, Wolfgang Thaller wrote:
> wolfgang 2005/03/09 00:51:45 PST
> Modified files:
> ghc/includes Storage.h
> ghc/rts GC.c Linker.c Storage.c
> 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
I've merged this, but I think a better solution might be for -fPIC to
generate code that calls a different version of newCaf (i.e. newDynCaf).
More information about the Cvs-ghc