/* -----------------------------------------------------------------------------
- * $Id: RtsFlags.c,v 1.68 2003/04/21 14:45:28 sof Exp $
+ * $Id: RtsFlags.c,v 1.74 2004/03/22 11:48:30 simonmar Exp $
*
* (c) The AQUA Project, Glasgow University, 1994-1997
* (c) The GHC Team, 1998-1999
/*
* Split argument lists
*/
-int prog_argc = 0; /* an "int" so as to match normal "argc" */
+int prog_argc = 0; /* an "int" so as to match normal "argc" */
char **prog_argv = NULL;
+char *prog_name = NULL; /* 'basename' of prog_argv[0] */
int rts_argc = 0; /* ditto */
char *rts_argv[MAX_RTS_ARGS];
RtsFlags.GcFlags.statsFile = NULL;
RtsFlags.GcFlags.giveStats = NO_GC_STATS;
- RtsFlags.GcFlags.maxStkSize = (1024 * 1024) / sizeof(W_);
+ RtsFlags.GcFlags.maxStkSize = (8 * 1024 * 1024) / sizeof(W_);
RtsFlags.GcFlags.initialStkSize = 1024 / sizeof(W_);
RtsFlags.GcFlags.minAllocAreaSize = (256 * 1024) / BLOCK_SIZE;
#if defined(GRAN)
/* ToDo: check defaults for GranSim and GUM */
- RtsFlags.GcFlags.maxStkSize = (1024 * 1024) / sizeof(W_);
+ RtsFlags.GcFlags.maxStkSize = (8 * 1024 * 1024) / sizeof(W_);
RtsFlags.GcFlags.initialStkSize = 1024 / sizeof(W_);
RtsFlags.GranFlags.maxThreads = 65536; // refers to mandatory threads
"",
" -? Prints this message and exits; the program is not executed",
"",
-" -K<size> Sets the maximum stack size (default 1M) Egs: -K32k -K512k",
-" -k<size> Sets the initial thread stack size (default 1k) Egs: -K4k -K2m",
+" -K<size> Sets the maximum stack size (default 8M) Egs: -K32k -K512k",
+" -k<size> Sets the initial thread stack size (default 1k) Egs: -k4k -k2m",
"",
" -A<size> Sets the minimum allocation area size (default 256k) Egs: -A1m -A10k",
" -M<size> Sets the maximum heap size (default unlimited) Egs: -M256k -M1G",
0
};
-static __inline__ rtsBool
+STATIC_INLINE rtsBool
strequal(const char *a, const char * b)
{
return(strcmp(a, b) == 0);
char *last_slash;
/* Remove directory from argv[0] -- default files in current directory */
-
- if ((last_slash = (char *) strrchr(argv[0], '/')) != NULL)
- strcpy(argv[0], last_slash+1);
+ if ((last_slash = (char *) strrchr(argv[0],
+#if !defined(mingw32_TARGET_OS)
+ '/')
+#else
+ '\\')
+#endif
+ ) != NULL) {
+ prog_name = last_slash+1;
+ } else {
+ prog_name = argv[0];
+ }
total_arg = *argc;
arg = 1;
# define TICKY_BUILD_ONLY(x) x
#else
# define TICKY_BUILD_ONLY(x) \
-prog_belch("GHC not built for: ticky-ticky stats"); \
+prog_belch("not built for: ticky-ticky stats"); \
error = rtsTrue;
#endif
# define COST_CENTRE_USING_BUILD_ONLY(x) x
#else
# define COST_CENTRE_USING_BUILD_ONLY(x) \
-prog_belch("GHC not built for: -prof or -parallel"); \
+prog_belch("not built for: -prof or -parallel"); \
error = rtsTrue;
#endif
# define PROFILING_BUILD_ONLY(x) x
#else
# define PROFILING_BUILD_ONLY(x) \
-prog_belch("GHC not built for: -prof"); \
+prog_belch("not built for: -prof"); \
error = rtsTrue;
#endif
# define SMP_BUILD_ONLY(x) x
#else
# define SMP_BUILD_ONLY(x) \
-prog_belch("GHC not built for: -smp"); \
+prog_belch("not built for: -smp"); \
error = rtsTrue;
#endif
# define PAR_BUILD_ONLY(x) x
#else
# define PAR_BUILD_ONLY(x) \
-prog_belch("GHC not built for: -parallel"); \
+prog_belch("not built for: -parallel"); \
error = rtsTrue;
#endif
# define PAR_OR_SMP_BUILD_ONLY(x) x
#else
# define PAR_OR_SMP_BUILD_ONLY(x) \
-prog_belch("GHC not built for: -parallel or -smp"); \
+prog_belch("not built for: -parallel or -smp"); \
error = rtsTrue;
#endif
# define GRAN_BUILD_ONLY(x) x
#else
# define GRAN_BUILD_ONLY(x) \
-prog_belch("GHC not built for: -gransim"); \
+prog_belch("not built for: -gransim"); \
error = rtsTrue;
#endif