Skip to content
  • wolfgang's avatar
    [project @ 2005-03-09 08:51:31 by wolfgang] · abde5fdf
    wolfgang authored
    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
    abde5fdf