summaryrefslogtreecommitdiff
path: root/rts/sm/GC.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2009-07-24 14:59:56 +0000
committerSimon Marlow <marlowsd@gmail.com>2009-07-24 14:59:56 +0000
commit0c6929858665ae0e9918fe0c6c71ce26fd4a4461 (patch)
tree82072950bfa9a009410906880524ef3f69f4fe4f /rts/sm/GC.c
parent2da67673279cf015ccc84270f6fd7935f64261a6 (diff)
downloadhaskell-0c6929858665ae0e9918fe0c6c71ce26fd4a4461.tar.gz
free the gc_thread structures during shutdown
Diffstat (limited to 'rts/sm/GC.c')
-rw-r--r--rts/sm/GC.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/rts/sm/GC.c b/rts/sm/GC.c
index 74880064e4..88b11aae88 100644
--- a/rts/sm/GC.c
+++ b/rts/sm/GC.c
@@ -937,6 +937,23 @@ initGcThreads (void)
}
}
+void
+freeGcThreads (void)
+{
+ if (gc_threads != NULL) {
+#if defined(THREADED_RTS)
+ nat i;
+ for (i = 0; i < RtsFlags.ParFlags.nNodes; i++) {
+ stgFree (gc_threads[i]);
+ }
+ stgFree (gc_threads);
+#else
+ stgFree (gc_threads);
+#endif
+ gc_threads = NULL;
+ }
+}
+
/* ----------------------------------------------------------------------------
Start GC threads
------------------------------------------------------------------------- */