diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2020-05-25 11:59:11 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-11-11 03:20:35 -0500 |
commit | c34a4b98b1f09ea3096d39a839a86f2d7185c796 (patch) | |
tree | bf3700fd70504a5676220df8702b41810e880846 /rts/CheckUnload.h | |
parent | 584058ddff71460023712a8d816b83b581e6e78f (diff) | |
download | haskell-c34a4b98b1f09ea3096d39a839a86f2d7185c796.tar.gz |
Fix and enable object unloading in GHCi
Fixes #16525 by tracking dependencies between object file symbols and
marking symbol liveness during garbage collection
See Note [Object unloading] in CheckUnload.c for details.
Diffstat (limited to 'rts/CheckUnload.h')
-rw-r--r-- | rts/CheckUnload.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/rts/CheckUnload.h b/rts/CheckUnload.h index ab85ead852..de07aef1c3 100644 --- a/rts/CheckUnload.h +++ b/rts/CheckUnload.h @@ -12,6 +12,34 @@ #include "BeginPrivate.h" -void checkUnload (StgClosure *static_objects); +#include "LinkerInternals.h" + +// Currently live objects +extern ObjectCode *objects; + +// Root set for object collection +extern ObjectCode *loaded_objects; + +// Mark bit for live objects +extern uint8_t object_code_mark_bit; + +// Number of object code currently marked for unloading. See the definition in +// CheckUnload.c for details. +extern int n_unloaded_objects; + +void initUnloadCheck(void); +void exitUnloadCheck(void); + +// Call before major GC to prepare section index table for marking +bool prepareUnloadCheck(void); + +// Mark object code of a static closure address as 'live' +void markObjectCode(const void *addr); + +// Call after major GC to unload unused and unmarked object code +void checkUnload(void); + +// Call on loaded object code +void insertOCSectionIndices(ObjectCode *oc); #include "EndPrivate.h" |