Fix building RTS with gcc 2.*; declare all variables at the top of a block
[ghc-hetmet.git] / rts / RtsStartup.c
index 951b07f..cdb45c6 100644 (file)
@@ -246,6 +246,7 @@ hs_init(int *argc, char **argv[])
     initProfiling1();
 
     /* start the virtual timer 'subsystem'. */
+    initTimer();
     startTimer();
 
     /* Initialise the stats department */
@@ -409,6 +410,7 @@ hs_exit_(rtsBool wait_foreign)
     
     /* stop the ticker */
     stopTimer();
+    exitTimer();
 
     /* reset the standard file descriptors to blocking mode */
     resetNonBlockingFd(0);
@@ -478,9 +480,8 @@ hs_exit_(rtsBool wait_foreign)
     reportCCSProfiling();
 #endif
 
-    freeProfiling1();
-
     endProfiling();
+    freeProfiling1();
 
 #ifdef PROFILING
     // Originally, this was in report_ccs_profiling().  Now, retainer