From: simonm Date: Fri, 26 Feb 1999 16:44:14 +0000 (+0000) Subject: [project @ 1999-02-26 16:44:13 by simonm] X-Git-Tag: Approximately_9120_patches~6504 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=892b901751581f2e73199e8c5e24731eebd67406;p=ghc-hetmet.git [project @ 1999-02-26 16:44:13 by simonm] Fix small stats bug in the -G1 case. --- diff --git a/ghc/rts/Main.c b/ghc/rts/Main.c index c363eb2..c286b98 100644 --- a/ghc/rts/Main.c +++ b/ghc/rts/Main.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Main.c,v 1.3 1999/01/21 10:31:47 simonm Exp $ + * $Id: Main.c,v 1.4 1999/02/26 16:44:13 simonm Exp $ * * (c) The GHC Team 1998-1999 * @@ -68,6 +68,8 @@ int main(int argc, char *argv[]) case Interrupted: /* carry on */ } + /* run all threads */ + run_all_threads(); shutdownHaskell(); stg_exit(EXIT_SUCCESS); } diff --git a/ghc/rts/Schedule.c b/ghc/rts/Schedule.c index 0f54706..ccb6b74 100644 --- a/ghc/rts/Schedule.c +++ b/ghc/rts/Schedule.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Schedule.c,v 1.10 1999/02/26 12:32:51 simonm Exp $ + * $Id: Schedule.c,v 1.11 1999/02/26 16:44:13 simonm Exp $ * * (c) The GHC Team, 1998-1999 * @@ -315,6 +315,14 @@ void initScheduler(void) enteredCAFs = END_CAF_LIST; } +void +run_all_threads ( void ) +{ + while (run_queue_hd != END_TSO_QUEUE) { + schedule(run_queue_hd, NULL); + } +} + /* ----------------------------------------------------------------------------- Main scheduling loop. diff --git a/ghc/rts/Storage.c b/ghc/rts/Storage.c index 0ba8a5e..017e537 100644 --- a/ghc/rts/Storage.c +++ b/ghc/rts/Storage.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Storage.c,v 1.14 1999/02/23 17:18:01 simonm Exp $ + * $Id: Storage.c,v 1.15 1999/02/26 16:44:14 simonm Exp $ * * (c) The GHC Team, 1998-1999 * @@ -387,7 +387,7 @@ calcLive(void) step *step; if (RtsFlags.GcFlags.generations == 1) { - live = g0s0->to_blocks * BLOCK_SIZE_W + + live = (g0s0->to_blocks - 1) * BLOCK_SIZE_W + ((lnat)g0s0->hp_bd->free - (lnat)g0s0->hp_bd->start) / sizeof(W_); return live; } @@ -402,7 +402,7 @@ calcLive(void) } step = &generations[g].steps[s]; live += (step->n_blocks - 1) * BLOCK_SIZE_W + - ((lnat)step->hp_bd->free -(lnat)step->hp_bd->start) / sizeof(W_); + ((lnat)step->hp_bd->free - (lnat)step->hp_bd->start) / sizeof(W_); } } return live;