Commit 892b9017 authored by simonm's avatar simonm
Browse files

[project @ 1999-02-26 16:44:13 by simonm]

Fix small stats bug in the -G1 case.
parent f2e845bb
/* -----------------------------------------------------------------------------
* $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);
}
......
/* -----------------------------------------------------------------------------
* $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.
......
/* -----------------------------------------------------------------------------
* $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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment