diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-09-11 06:16:18 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-09-16 15:30:20 -0400 |
commit | 9c748240149aa27af74ca721b2c1d144ed82a1a1 (patch) | |
tree | dd1c3224df62b9946c3b21afb8e226111912aed8 /rts/LinkerInternals.h | |
parent | 9436cac081931b83c54a906e7f2c5fe32e868c81 (diff) | |
download | haskell-wip/initializers.tar.gz |
rts: Refactor unloading of foreign export StablePtrswip/initializers
Previously we would allocate a linked list cell for each foreign export.
Now we can avoid this by taking advantage of the fact that they are
already broken into groups.
Diffstat (limited to 'rts/LinkerInternals.h')
-rw-r--r-- | rts/LinkerInternals.h | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h index 1f63f0c485..2e76a888e4 100644 --- a/rts/LinkerInternals.h +++ b/rts/LinkerInternals.h @@ -135,17 +135,6 @@ typedef struct _Segment { int n_sections; } Segment; -/* - * We must keep track of the StablePtrs that are created for foreign - * exports by constructor functions when the module is loaded, so that - * we can free them again when the module is unloaded. If we don't do - * this, then the StablePtr will keep the module alive indefinitely. - */ -typedef struct ForeignExportStablePtr_ { - StgStablePtr stable_ptr; - struct ForeignExportStablePtr_ *next; -} ForeignExportStablePtr; - #if defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH) #define NEED_SYMBOL_EXTRAS 1 #endif @@ -240,7 +229,8 @@ typedef struct _ObjectCode { char* bssBegin; char* bssEnd; - ForeignExportStablePtr *stable_ptrs; + /* a list of all ForeignExportsLists owned by this object */ + struct ForeignExportsList *foreign_exports; /* Holds the list of symbols in the .o file which require extra information.*/ |