X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FRtsFlags.c;h=25d53da1fe71981a068ae697d00386bde6d82ff7;hb=4417e97d436e2796bed886cb1a830acb88d3da28;hp=37c22d1db01d58958c2669b08d0e64ffe9701842;hpb=4e48260554b72e73932a8d5b7c097a047814ab83;p=ghc-hetmet.git diff --git a/ghc/rts/RtsFlags.c b/ghc/rts/RtsFlags.c index 37c22d1..25d53da 100644 --- a/ghc/rts/RtsFlags.c +++ b/ghc/rts/RtsFlags.c @@ -152,7 +152,7 @@ void initRtsFlagsDefaults(void) RtsFlags.GcFlags.maxStkSize = (8 * 1024 * 1024) / sizeof(W_); RtsFlags.GcFlags.initialStkSize = 1024 / sizeof(W_); - RtsFlags.GcFlags.minAllocAreaSize = (256 * 1024) / BLOCK_SIZE; + RtsFlags.GcFlags.minAllocAreaSize = (512 * 1024) / BLOCK_SIZE; RtsFlags.GcFlags.minOldGenSize = (1024 * 1024) / BLOCK_SIZE; RtsFlags.GcFlags.maxHeapSize = 0; /* off by default */ RtsFlags.GcFlags.heapSizeSuggestion = 0; /* none */ @@ -173,6 +173,7 @@ void initRtsFlagsDefaults(void) #ifdef RTS_GTK_FRONTPANEL RtsFlags.GcFlags.frontpanel = rtsFalse; #endif + RtsFlags.GcFlags.idleGCDelayTicks = 300 / TICK_MILLISECS; /* ticks */ #ifdef DEBUG RtsFlags.DebugFlags.scheduler = rtsFalse; @@ -189,6 +190,7 @@ void initRtsFlagsDefaults(void) RtsFlags.DebugFlags.gran = rtsFalse; RtsFlags.DebugFlags.par = rtsFalse; RtsFlags.DebugFlags.linker = rtsFalse; + RtsFlags.DebugFlags.squeeze = rtsFalse; #endif #if defined(PROFILING) || defined(PAR) @@ -346,6 +348,9 @@ usage_text[] = { " -c Auto-enable compaction of the oldest generation when live data is", " at least % of the maximum heap size set with -M (default: 30%)", " -c Enable compaction for all major collections", +#if defined(THREADED_RTS) +" -I Perform full GC after idle time (default: 0.3, 0 == off)", +#endif "", " -t One-line GC statistics (default file: .stat)", " -s Summary GC statistics (with -Sstderr going to stderr)", @@ -427,8 +432,9 @@ usage_text[] = { " -DP DEBUG: par", " -Dl DEBUG: linker", " -Dm DEBUG: stm", +" -Dz DEBUG: stack squezing", "", -#endif // DEBUG +#endif /* DEBUG */ #if defined(SMP) " -N Use OS threads (default: 1)", #endif @@ -722,6 +728,9 @@ error = rtsTrue; case 'm': RtsFlags.DebugFlags.stm = rtsTrue; break; + case 'z': + RtsFlags.DebugFlags.squeeze = rtsTrue; + break; default: bad_option( rts_argv[arg] ); } @@ -793,6 +802,23 @@ error = rtsTrue; break; #endif + case 'I': /* idle GC delay */ + if (rts_argv[arg][2] == '\0') { + /* use default */ + } else { + I_ cst; /* tmp */ + + /* Convert to ticks */ + cst = (I_) ((atof(rts_argv[arg]+2) * 1000)); + if (cst > 0 && cst < TICK_MILLISECS) { + cst = TICK_MILLISECS; + } else { + cst = cst / TICK_MILLISECS; + } + RtsFlags.GcFlags.idleGCDelayTicks = cst; + } + break; + case 'S': RtsFlags.GcFlags.giveStats = VERBOSE_GC_STATS; goto stats; @@ -973,7 +999,7 @@ error = rtsTrue; error = rtsTrue; } ) -#endif // PROFILING +#endif /* PROFILING */ break; #if defined(PROFILING) @@ -2188,20 +2214,25 @@ bad_option(const char *s) void setProgName(char *argv[]) { - char *last_slash; - /* Remove directory from argv[0] -- default files in current directory */ - if ((last_slash = (char *) strrchr(argv[0], #if !defined(mingw32_HOST_OS) - '/' -#else - '\\' -#endif - )) != NULL) { + char *last_slash; + if ( (last_slash = (char *) strrchr(argv[0], '/')) != NULL ) { prog_name = last_slash+1; } else { prog_name = argv[0]; } +#else + char* last_slash = argv[0] + (strlen(argv[0]) - 1); + while ( last_slash > argv[0] ) { + if ( *last_slash == '/' || *last_slash == '\\' ) { + prog_name = last_slash+1; + return; + } + last_slash--; + } + prog_name = argv[0]; +#endif } void