Commit d7a3328c authored by Ben Gamari's avatar Ben Gamari 🐢

Sanity: Check nonmoving heap sanity after concurrent GC

parent 41a8c572
......@@ -10,6 +10,7 @@
#include "RtsUtils.h"
#include "Capability.h"
#include "Printer.h"
#include "Sanity.h"
#include "Storage.h"
// We call evacuate, which expects the thread-local gc_thread to be valid;
// This is sometimes declared as a register variable therefore it is necessary
......
......@@ -87,7 +87,10 @@ checkLargeBitmap( StgPtr payload, StgLargeBitmap* large_bitmap, uint32_t size )
static void
checkClosureShallow( const StgClosure* p )
{
ASSERT(LOOKS_LIKE_CLOSURE_PTR(UNTAG_CONST_CLOSURE(p)));
const StgClosure *q;
q = UNTAG_CONST_CLOSURE(p);
ASSERT(LOOKS_LIKE_CLOSURE_PTR(q));
}
// check an individual stack object
......@@ -467,7 +470,13 @@ checkClosure( const StgClosure* p )
void checkHeapChain (bdescr *bd)
{
for (; bd != NULL; bd = bd->link) {
if(!(bd->flags & BF_SWEPT)) {
if (false && bd->flags & BF_NONMOVING) {
struct NonmovingSegment *seg = (struct NonmovingSegment *) bd->start;
for (nonmoving_block_idx i=0; i < nonmovingSegmentBlockCount(seg); i++) {
if (nonmovingGetMark(seg, i) == nonmovingMarkEpoch)
checkClosure((StgClosure *) nonmovingSegmentGetBlock(seg, i));
}
} else if(!(bd->flags & BF_SWEPT)) {
StgPtr p = bd->start;
while (p < bd->free) {
uint32_t size = checkClosure((StgClosure *)p);
......
......@@ -23,6 +23,7 @@
void checkSanity ( bool after_gc, bool major_gc );
void checkNurserySanity ( nursery *nursery );
void checkHeapChain ( bdescr *bd );
void checkNonmovingHeap ( const struct NonmovingHeap *heap );
void checkHeapChunk ( StgPtr start, StgPtr end );
void checkLargeObjects ( bdescr *bd );
void checkTSO ( StgTSO* tso );
......
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