X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FSanity.c;h=8f3b627a2bbae3c8505b81ae16de6d1e6625f9e2;hb=2dce32ca5188120ca220a36139ff216b852b389e;hp=3eea3cd11c82ed7cfea411560af1fc460b45c638;hpb=fef454a0f84acdf9e4efbce6425a04fbbb577dbe;p=ghc-hetmet.git diff --git a/rts/Sanity.c b/rts/Sanity.c index 3eea3cd..8f3b627 100644 --- a/rts/Sanity.c +++ b/rts/Sanity.c @@ -793,6 +793,14 @@ checkGlobalTSOList (rtsBool checkTSOs) ASSERT(get_itbl(tso)->type == TSO); if (checkTSOs) checkTSO(tso); + + // If this TSO is dirty and in an old generation, it better + // be on the mutable list. + if (tso->what_next == ThreadRelocated) continue; + if (tso->flags & (TSO_DIRTY|TSO_LINK_DIRTY)) { + ASSERT(Bdescr((P_)tso)->gen_no == 0 || tso->flags & TSO_MARKED); + tso->flags &= ~TSO_MARKED; + } } } } @@ -812,10 +820,27 @@ checkMutableList( bdescr *mut_bd, nat gen ) for (q = bd->start; q < bd->free; q++) { p = (StgClosure *)*q; ASSERT(!HEAP_ALLOCED(p) || Bdescr((P_)p)->gen_no == gen); + if (get_itbl(p)->type == TSO) { + ((StgTSO *)p)->flags |= TSO_MARKED; + } } } } +void +checkMutableLists (void) +{ + nat g, i; + + for (g = 0; g < RtsFlags.GcFlags.generations; g++) { + checkMutableList(generations[g].mut_list, g); + for (i = 0; i < n_capabilities; i++) { + checkMutableList(capabilities[i].mut_lists[g], g); + } + } + checkGlobalTSOList(rtsTrue); +} + /* Check the static objects list. */