• Simon Marlow's avatar
    Really unload object code when it is safe to do so (#8039) · bdfefb3b
    Simon Marlow authored
    The next major GC after an unloadObj() will do a traversal of the heap
    to determine whether the object code can be removed from memory or
    not.  We'll keep doing these until it is safe to remove the object
    In my experiments with GHCi, the objects get unloaded immediately,
    which is a good sign: we're not accidentally holding on to any
    references anywhere in the GHC data structures.
    Changes relative to the patch earlier posted on the ticket:
     - fix two memory leaks discovered with Valgrind, after
       testing with tests/rts/linker_unload.c
Linker.c 245 KB