diff options
author | Simon Marlow <marlowsd@gmail.com> | 2013-07-05 15:57:32 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2013-08-22 10:54:09 +0100 |
commit | bdfefb3b72a71cd0afca6e7766456c0d97c47c86 (patch) | |
tree | 383142642ac70f002f403147d97c51d7e0f609ed /rts/CheckUnload.h | |
parent | 372053c968ef92dbb822afe38f4ce70c3a7553af (diff) | |
download | haskell-bdfefb3b72a71cd0afca6e7766456c0d97c47c86.tar.gz |
Really unload object code when it is safe to do so (#8039)
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
code.
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
Diffstat (limited to 'rts/CheckUnload.h')
-rw-r--r-- | rts/CheckUnload.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/rts/CheckUnload.h b/rts/CheckUnload.h new file mode 100644 index 0000000000..7d2e5b1321 --- /dev/null +++ b/rts/CheckUnload.h @@ -0,0 +1,20 @@ +/* ---------------------------------------------------------------------------- + * + * (c) The GHC Team, 2013- + * + * Check whether dynamically-loaded object code can be safely + * unloaded, by searching for references to it from the heap and RTS + * data structures. + * + * --------------------------------------------------------------------------*/ + +#ifndef CHECKUNLOAD_H +#define CHECKUNLOAD_H + +#include "BeginPrivate.h" + +void checkUnload (StgClosure *static_objects); + +#include "EndPrivate.h" + +#endif // CHECKUNLOAD_H |