diff options
author | Simon Marlow <marlowsd@gmail.com> | 2013-11-21 12:27:27 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2013-11-21 13:27:34 +0000 |
commit | 5874f13fd83409b28c4f781a93e80f4605d0593e (patch) | |
tree | e1d2abfea7c3aad84a623c7afa0b8051ca568db4 /includes | |
parent | beaf8c370a25fdba1eb5d4aca820ea4677ade062 (diff) | |
download | haskell-5874f13fd83409b28c4f781a93e80f4605d0593e.tar.gz |
Allow the linker to be used without retaining CAFs unconditionally
This creates a new C API:
initLinker_ (int retain_cafs)
The old initLinker() was left as-is for backwards compatibility. See
documentation in Linker.h.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/rts/Linker.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/includes/rts/Linker.h b/includes/rts/Linker.h index ea4daebc8a..e7e2ea5ce5 100644 --- a/includes/rts/Linker.h +++ b/includes/rts/Linker.h @@ -22,8 +22,25 @@ typedef char pathchar; #define PATH_FMT "s" #endif -/* initialize the object linker */ -void initLinker( void ); +/* Initialize the object linker. Equivalent to initLinker_(1). */ +void initLinker (void); + +/* Initialize the object linker. + * The retain_cafs argument is: + * + * non-zero => Retain CAFs unconditionally in linked Haskell code. + * Note that this prevents any code from being unloaded. + * It should not be necessary unless you are GHCi or + * hs-plugins, which needs to be able call any function + * in the compiled code. + * + * zero => Do not retain CAFs. Everything reachable from foreign + * exports will be retained, due to the StablePtrs + * created by the module initialisation code. unloadObj + * free these StablePtrs, which will allow the CAFs to + * be GC'd and the code to be removed. + */ +void initLinker_ (int retain_cafs); /* insert a symbol in the hash table */ void insertSymbol(pathchar* obj_name, char* key, void* data); |