[project @ 1999-03-03 19:20:41 by sof]
[ghc-hetmet.git] / ghc / rts / Main.c
index 2b7433a..1b7bcba 100644 (file)
@@ -1,17 +1,21 @@
 /* -----------------------------------------------------------------------------
- * $Id: Main.c,v 1.2 1998/12/02 13:28:30 simonm Exp $
+ * $Id: Main.c,v 1.6 1999/03/03 19:20:42 sof Exp $
+ *
+ * (c) The GHC Team 1998-1999
  *
  * Main function for a standalone Haskell program.
  *
  * ---------------------------------------------------------------------------*/
 
+#define COMPILING_RTS_MAIN
+
 #include "Rts.h"
 #include "RtsAPI.h"
+#include "RtsFlags.h"
 #include "Schedule.h"  /* for MainTSO */
 #include "RtsUtils.h"
 
 #ifdef DEBUG
-#include "RtsFlags.h"  /* for debugging flags */
 #include "Printer.h"   /* for printing        */
 #endif
 
@@ -35,14 +39,18 @@ int main(int argc, char *argv[])
     startupHaskell(argc,argv);
 
 #ifndef PAR
-    MainTSO = createIOThread(BLOCK_SIZE_W,(StgClosure *)&mainIO_closure);
+    MainTSO = createIOThread(stg_max(BLOCK_SIZE_W,
+                                    RtsFlags.GcFlags.initialStkSize),
+                            (StgClosure *)&mainIO_closure);
     status = schedule(MainTSO,NULL);
 #else
     if (IAmMainThread == rtsTrue) {
     /*Just to show we're alive */
       fprintf(stderr, "Main Thread Started ...\n");
      
-      MainTSO = createIOThread(BLOCK_SIZE_W,(StgClosure *)&mainIO_closure);
+      MainTSO = createIOThread(stg_max(BLOCK_SIZE_W,
+                                      RtsFlags.GcFlags.initialStkSize),
+                              (StgClosure *)&mainIO_closure);
       status = schedule(MainTSO,NULL);
     } else {
       WaitForPEOp(PP_FINISH,SysManTask);