/* -----------------------------------------------------------------------------
- * $Id: RtsFlags.c,v 1.2 1998/12/02 13:28:39 simonm Exp $
+ * $Id: RtsFlags.c,v 1.12 1999/03/25 13:14:07 simonm Exp $
+ *
+ * (c) The AQUA Project, Glasgow University, 1994-1997
+ * (c) The GHC Team, 1998-1999
*
* Functions for parsing the argument list.
*
RtsFlags.GcFlags.initialStkSize = 1024 / sizeof(W_);
RtsFlags.GcFlags.minAllocAreaSize = (256 * 1024) / BLOCK_SIZE;
+ RtsFlags.GcFlags.minOldGenSize = (1024 * 1024) / BLOCK_SIZE;
RtsFlags.GcFlags.maxHeapSize = (64 * 1024 * 1024) / BLOCK_SIZE;
+ RtsFlags.GcFlags.heapSizeSuggestion = 0; /* none */
RtsFlags.GcFlags.pcFreeHeap = 3; /* 3% */
+ RtsFlags.GcFlags.oldGenFactor = 2;
+ RtsFlags.GcFlags.generations = 2;
+ RtsFlags.GcFlags.steps = 2;
- RtsFlags.GcFlags.force2s = rtsFalse;
RtsFlags.GcFlags.forceGC = rtsFalse;
RtsFlags.GcFlags.forcingInterval = 5000000; /* 5MB (or words?) */
RtsFlags.GcFlags.ringBell = rtsFalse;
#ifdef TICKY_TICKY
RtsFlags.TickyFlags.showTickyStats = rtsFalse;
RtsFlags.TickyFlags.tickyFile = NULL;
-
- AllFlags.doUpdEntryCounts = rtsTrue; /*ToDo:move? */
#endif
}
" -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 64M) Egs: -H256k -H1G",
+" -M<size> Sets the maximum heap size (default 64M) Egs: -M256k -M1G",
+" -H<size> Sets the minimum heap size (default 0M) Egs: -H24m -H1G",
" -m<n>% Minimum % of heap which must be available (default 3%)",
+" -G<n> Number of generations (default: 2)",
+" -T<n> Number of steps in younger generations (default: 2)",
" -s<file> Summary GC statistics (default file: <program>.stat)",
" -S<file> Detailed GC statistics (with -Sstderr going to stderr)",
"",
" -r<file> Produce reduction profiling statistics (with -rstderr for stderr)",
"",
#endif
-" -T<level> Trace garbage collection execution (debugging)",
-"",
# ifdef PAR
" -N<n> Use <n> PVMish processors in parallel (default: 2)",
/* NB: the -N<n> is implemented by the driver!! */
RtsFlags.GcFlags.ringBell = rtsTrue;
break;
+ case 'F':
+ RtsFlags.GcFlags.oldGenFactor = atof(rts_argv[arg]+2);
+
+ if (RtsFlags.GcFlags.oldGenFactor < 0)
+ bad_option( rts_argv[arg] );
+ break;
+
#ifdef DEBUG
case 'D':
/* hack warning: interpret the flags as a binary number */
- *(int*)(&RtsFlags.DebugFlags) = decode(rts_argv[arg]+2);
+ {
+ I_ n = decode(rts_argv[arg]+2);
+ if (n &1) RtsFlags.DebugFlags.scheduler = rtsTrue;
+ if ((n>>1)&1) RtsFlags.DebugFlags.evaluator = rtsTrue;
+ if ((n>>2)&1) RtsFlags.DebugFlags.codegen = rtsTrue;
+ if ((n>>3)&1) RtsFlags.DebugFlags.weak = rtsTrue;
+ if ((n>>4)&1) RtsFlags.DebugFlags.gccafs = rtsTrue;
+ if ((n>>5)&1) RtsFlags.DebugFlags.gc = rtsTrue;
+ if ((n>>6)&1) RtsFlags.DebugFlags.block_alloc = rtsTrue;
+ if ((n>>7)&1) RtsFlags.DebugFlags.sanity = rtsTrue;
+ if ((n>>8)&1) RtsFlags.DebugFlags.stable = rtsTrue;
+ if ((n>>9)&1) RtsFlags.DebugFlags.prof = rtsTrue;
+ }
break;
#endif
- case 'F':
- if (strequal(rts_argv[arg]+2, "2s")) {
- RtsFlags.GcFlags.force2s = rtsTrue;
- } else {
- bad_option( rts_argv[arg] );
- }
- break;
-
case 'K':
RtsFlags.GcFlags.maxStkSize =
decode(rts_argv[arg]+2) / sizeof(W_);
bad_option( rts_argv[arg] );
break;
+ case 'G':
+ RtsFlags.GcFlags.generations = decode(rts_argv[arg]+2);
+ if (RtsFlags.GcFlags.generations < 1) {
+ bad_option(rts_argv[arg]);
+ }
+ break;
+
+ case 'T':
+ RtsFlags.GcFlags.steps = decode(rts_argv[arg]+2);
+ if (RtsFlags.GcFlags.steps < 1) {
+ bad_option(rts_argv[arg]);
+ }
+ break;
+
case 'H':
- /* ignore for compatibility with older versions */
+ RtsFlags.GcFlags.heapSizeSuggestion =
+ decode(rts_argv[arg]+2) / BLOCK_SIZE;
+
+ if (RtsFlags.GcFlags.heapSizeSuggestion <= 0) {
+ bad_option(rts_argv[arg]);
+ }
break;
case 'j': /* force GC option */