summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2006-03-30 13:41:58 +0000
committerSimon Marlow <simonmar@microsoft.com>2006-03-30 13:41:58 +0000
commit71d6db2260d3d5c3395818cd18564193845555e6 (patch)
treea788aaa12b84d61268d99b311e0d691de5a93470
parentacd07df5e2960d02d91717eedbeb681224024216 (diff)
downloadhaskell-71d6db2260d3d5c3395818cd18564193845555e6.tar.gz
fix profiling on Win32
The recent patch to free memory in hs_exit() on Win32 unfortunately broke profiling, because it freed the memory slightly too early.
-rw-r--r--ghc/configure.ac2
-rw-r--r--ghc/rts/RtsStartup.c10
-rw-r--r--ghc/rts/Storage.c5
3 files changed, 12 insertions, 5 deletions
diff --git a/ghc/configure.ac b/ghc/configure.ac
index b6d9a4cb84..77b5497399 100644
--- a/ghc/configure.ac
+++ b/ghc/configure.ac
@@ -1,5 +1,5 @@
# Initialise and check sanity.
-AC_INIT([The Glorious Glasgow Haskell Compilation System], [6.5], [glasgow-haskell-bugs@haskell.org], [ghc])
+AC_INIT([The Glorious Glasgow Haskell Compilation System], [6.5.20060329], [glasgow-haskell-bugs@haskell.org], [ghc])
AC_CONFIG_SRCDIR([ghc.spec.in])
# duplicate from ../configure.ac
diff --git a/ghc/rts/RtsStartup.c b/ghc/rts/RtsStartup.c
index faf45967b0..32c73f43c6 100644
--- a/ghc/rts/RtsStartup.c
+++ b/ghc/rts/RtsStartup.c
@@ -373,9 +373,8 @@ hs_exit(void)
/* stop timing the shutdown, we're about to print stats */
stat_endExit();
- /* clean up things from the storage manager's point of view.
- * also outputs the stats (+RTS -s) info.
- */
+ // clean up things from the storage manager's point of view.
+ // also outputs the stats (+RTS -s) info.
exitStorage();
#ifdef RTS_GTK_FRONTPANEL
@@ -398,7 +397,7 @@ hs_exit(void)
// during endProfiling().
fclose(prof_file);
#endif
-
+
#if defined(TICKY_TICKY)
if (RtsFlags.TickyFlags.showTickyStats) PrintTickyInfo();
#endif
@@ -406,6 +405,9 @@ hs_exit(void)
#if defined(mingw32_HOST_OS)
shutdownAsyncIO();
#endif
+
+ // Finally, free all our storage.
+ freeStorage();
}
// Compatibility interfaces
diff --git a/ghc/rts/Storage.c b/ghc/rts/Storage.c
index 5e00a57026..974be45f10 100644
--- a/ghc/rts/Storage.c
+++ b/ghc/rts/Storage.c
@@ -266,6 +266,11 @@ void
exitStorage (void)
{
stat_exit(calcAllocated());
+}
+
+void
+freeStorage (void)
+{
freeAllMBlocks();
}