diff options
Diffstat (limited to 'src/harness_adapter.c')
-rw-r--r-- | src/harness_adapter.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/harness_adapter.c b/src/harness_adapter.c index b18f8d2..8663b6a 100644 --- a/src/harness_adapter.c +++ b/src/harness_adapter.c @@ -16,6 +16,8 @@ void* get_foreign_interface() return foreign_interface; } +extern void performMajorGC(); + void plugin_metaload(int argc, char** argv) { hs_init(&argc, &argv); @@ -25,7 +27,14 @@ void plugin_load(int argc, char **argv, foreign_interface_t* fintf) { hs_init(&argc, &argv); foreign_interface = fintf; } + void plugin_teardown(opqst_t st) { + // the opaque state should be dereferenced by now. Perform a major GC to help + // clean up before doing a reload. + // + // Used primarily in the case where the RTS is kept alive when performing a + // hot-reload. + performMajorGC(); hs_exit(); // There's a race condition between when this shared library is unloaded and |