From 59f3fefdf72e008be49066c62c7419b11c6cfcf1 Mon Sep 17 00:00:00 2001 From: simonm Date: Mon, 18 Jan 1999 15:18:06 +0000 Subject: [PATCH] [project @ 1999-01-18 15:18:06 by simonm] - do MVARs properly. - skip over slop between objects, by searching for the first info pointer. this works for slop created by updates, for example. --- ghc/rts/Sanity.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ghc/rts/Sanity.c b/ghc/rts/Sanity.c index 1ba464d..cef528a 100644 --- a/ghc/rts/Sanity.c +++ b/ghc/rts/Sanity.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Sanity.c,v 1.4 1999/01/15 17:57:10 simonm Exp $ + * $Id: Sanity.c,v 1.5 1999/01/18 15:18:06 simonm Exp $ * * Sanity checking code for the heap and stack. * @@ -193,6 +193,16 @@ checkClosure( StgClosure* p ) } return bco_sizeW(bco); } + + case MVAR: + { + StgMVar *mvar = (StgMVar *)p; + ASSERT(LOOKS_LIKE_PTR(mvar->head)); + ASSERT(LOOKS_LIKE_PTR(mvar->tail)); + ASSERT(LOOKS_LIKE_PTR(mvar->value)); + return sizeofW(StgMVar); + } + case FUN: case THUNK: case CONSTR: @@ -205,7 +215,6 @@ checkClosure( StgClosure* p ) case BLACKHOLE: case BLACKHOLE_BQ: case FOREIGN: - case MVAR: case MUT_VAR: case CONSTR_INTLIKE: case CONSTR_CHARLIKE: @@ -331,7 +340,8 @@ checkHeap(bdescr *bd, StgPtr start) /* This is the smallest size of closure that can live in the heap. */ ASSERT( size >= MIN_NONUPD_SIZE + sizeofW(StgHeader) ); p += size; - while (*p == 0) { p++; } /* skip over slop */ + while (p < bd->free && + *p && !LOOKS_LIKE_GHC_INFO(*p)) { p++; } /* skip over slop */ } bd = bd->link; if (bd != NULL) { -- 1.7.10.4