allow build settings to be overriden by adding mk/validate.mk
[ghc-hetmet.git] / rts / RtsStartup.c
index 85b1c02..7dce06e 100644 (file)
@@ -38,8 +38,9 @@
 #include "FrontPanel.h"
 #endif
 
-#if defined(PROFILING) || defined(DEBUG)
 # include "Profiling.h"
+
+#if defined(PROFILING)
 # include "ProfHeap.h"
 # include "RetainerProfile.h"
 #endif
@@ -212,9 +213,6 @@ hs_init(int *argc, char **argv[])
     synchroniseSystem();             // calls initParallelSystem etc
 #endif /* PAR */
 
-    /* Perform initialisation of adjustor thunk layer. */
-    initAdjustor();
-
     /* initialise scheduler data structures (needs to be done before
      * initStorage()).
      */
@@ -244,9 +242,7 @@ hs_init(int *argc, char **argv[])
     initThreadLabelTable();
 #endif
 
-#if defined(PROFILING) || defined(DEBUG)
     initProfiling1();
-#endif
 
     /* start the virtual timer 'subsystem'. */
     startTimer();
@@ -353,11 +349,9 @@ hs_add_root(void (*init_root)(void))
 
     startupHpc();
 
-#if defined(PROFILING) || defined(DEBUG)
     // This must be done after module initialisation.
     // ToDo: make this work in the presence of multiple hs_add_root()s.
     initProfiling2();
-#endif
 }
 
 /* -----------------------------------------------------------------------------
@@ -455,18 +449,13 @@ hs_exit(void)
     /* free the stable pointer table */
     exitStablePtrTable();
 
-#if defined(PROFILING) || defined(DEBUG)
     freeProfiling1();
-#endif
 
 #if defined(DEBUG)
     /* free the thread label table */
     freeThreadLabelTable();
 #endif
 
-    /* free hash table storage */
-    exitHashTable();
-
 #ifdef RTS_GTK_FRONTPANEL
     if (RtsFlags.GcFlags.frontpanel) {
        stopFrontPanel();
@@ -477,9 +466,7 @@ hs_exit(void)
     reportCCSProfiling();
 #endif
 
-#if defined(PROFILING) || defined(DEBUG)
     endProfiling();
-#endif
 
 #ifdef PROFILING
     // Originally, this was in report_ccs_profiling().  Now, retainer
@@ -496,6 +483,9 @@ hs_exit(void)
     shutdownAsyncIO();
 #endif
 
+    /* free hash table storage */
+    exitHashTable();
+
     // Finally, free all our storage
     freeStorage();