{
const StgInfoTable *info;
- ASSERT(LOOKS_LIKE_INFO_PTR(p->header.info));
+ ASSERT(LOOKS_LIKE_CLOSURE_PTR(p));
p = UNTAG_CLOSURE(p);
/* Is it a static closure (i.e. in the data segment)? */
ASSERT(!closure_STATIC(p));
}
- info = get_itbl(p);
+ info = p->header.info;
+
+ if (IS_FORWARDING_PTR(info)) {
+ barf("checkClosure: found EVACUATED closure %d", info->type);
+ }
+ info = INFO_PTR_TO_STRUCT(info);
+
switch (info->type) {
case MVAR_CLEAN:
case IND_PERM:
case IND_OLDGEN:
case IND_OLDGEN_PERM:
-#ifdef TICKY_TICKY
- case SE_BLACKHOLE:
- case SE_CAF_BLACKHOLE:
-#endif
case BLACKHOLE:
case CAF_BLACKHOLE:
case STABLE_NAME:
return sizeofW(StgTRecHeader);
}
-
- case EVACUATED:
- barf("checkClosure: found EVACUATED closure %d",
- info->type);
default:
barf("checkClosure (closure type %d)", info->type);
}
/* skip over slop */
while (p < bd->free &&
- (*p < 0x1000 || !LOOKS_LIKE_INFO_PTR((void*)*p))) { p++; }
+ (*p < 0x1000 || !LOOKS_LIKE_INFO_PTR(*p))) { p++; }
}
}
}
nat size;
for (p=start; p<end; p+=size) {
- ASSERT(LOOKS_LIKE_INFO_PTR((void*)*p));
+ ASSERT(LOOKS_LIKE_INFO_PTR(*p));
size = checkClosure((StgClosure *)p);
/* This is the smallest size of closure that can live in the heap. */
ASSERT( size >= MIN_PAYLOAD_SIZE + sizeofW(StgHeader) );
#endif
void
-checkChain(bdescr *bd)
+checkLargeObjects(bdescr *bd)
{
while (bd != NULL) {
- checkClosure((StgClosure *)bd->start);
+ if (!(bd->flags & BF_PINNED)) {
+ checkClosure((StgClosure *)bd->start);
+ }
bd = bd->link;
}
}
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;
+ }
}
}
}
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 (rtsBool checkTSOs)
+{
+ 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(checkTSOs);
+}
+
/*
Check the static objects list.
*/
StgClosure *indirectee = UNTAG_CLOSURE(((StgIndStatic *)p)->indirectee);
ASSERT(LOOKS_LIKE_CLOSURE_PTR(indirectee));
- ASSERT(LOOKS_LIKE_INFO_PTR(indirectee->header.info));
+ ASSERT(LOOKS_LIKE_INFO_PTR((StgWord)indirectee->header.info));
p = *IND_STATIC_LINK((StgClosure *)p);
break;
}