summaryrefslogtreecommitdiff
path: root/rts/Sanity.c
diff options
context:
space:
mode:
authorSimon Marlow <simonmarhaskell@gmail.com>2008-04-16 23:44:20 +0000
committerSimon Marlow <simonmarhaskell@gmail.com>2008-04-16 23:44:20 +0000
commit200c73fdfea734765c48309cc8dcbcf44b69c8c5 (patch)
tree3c2368de05e5050dede56981076c7a9bbfcea457 /rts/Sanity.c
parent233a468745d108ea845e0898e4177df2c3734fc0 (diff)
downloadhaskell-200c73fdfea734765c48309cc8dcbcf44b69c8c5.tar.gz
Don't traverse the entire list of threads on every GC (phase 1)
Instead of keeping a single list of all threads, keep one per step and only look at the threads belonging to steps that we are collecting.
Diffstat (limited to 'rts/Sanity.c')
-rw-r--r--rts/Sanity.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/rts/Sanity.c b/rts/Sanity.c
index e90a5736e5..b8bf5d4183 100644
--- a/rts/Sanity.c
+++ b/rts/Sanity.c
@@ -781,13 +781,17 @@ checkThreadQsSanity (rtsBool check_TSO_too)
void
checkGlobalTSOList (rtsBool checkTSOs)
{
- extern StgTSO *all_threads;
StgTSO *tso;
- for (tso=all_threads; tso != END_TSO_QUEUE; tso = tso->global_link) {
- ASSERT(LOOKS_LIKE_CLOSURE_PTR(tso));
- ASSERT(get_itbl(tso)->type == TSO);
- if (checkTSOs)
- checkTSO(tso);
+ nat s;
+
+ for (s = 0; s < total_steps; s++) {
+ for (tso=all_steps[s].threads; tso != END_TSO_QUEUE;
+ tso = tso->global_link) {
+ ASSERT(LOOKS_LIKE_CLOSURE_PTR(tso));
+ ASSERT(get_itbl(tso)->type == TSO);
+ if (checkTSOs)
+ checkTSO(tso);
+ }
}
}