summaryrefslogtreecommitdiff
path: root/rts/Stable.c
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2006-08-08 10:31:10 +0000
committerSimon Marlow <simonmar@microsoft.com>2006-08-08 10:31:10 +0000
commit9f2ceb4da7dfbc1cfd09ce54610ebe64288b9007 (patch)
treec8a72bc8d7e4663c9b5f789d54a6a69bfbba4340 /rts/Stable.c
parent3098d2143a5865f8f1fba1d7d72132b140f2de94 (diff)
downloadhaskell-9f2ceb4da7dfbc1cfd09ce54610ebe64288b9007.tar.gz
Remember to free() memory on exit
Patch mostly from Lennart Augustsson in #803, with additions to Task.c by me.
Diffstat (limited to 'rts/Stable.c')
-rw-r--r--rts/Stable.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/rts/Stable.c b/rts/Stable.c
index 2391cb127f..5a1b92b321 100644
--- a/rts/Stable.c
+++ b/rts/Stable.c
@@ -159,6 +159,18 @@ initStablePtrTable(void)
#endif
}
+void
+exitStablePtrTable(void)
+{
+ if (addrToStableHash)
+ freeHashTable(addrToStableHash, NULL);
+ addrToStableHash = NULL;
+ if (stable_ptr_table)
+ stgFree(stable_ptr_table);
+ stable_ptr_table = NULL;
+ SPT_size = 0;
+}
+
/*
* get at the real stuff...remove indirections.
*