From d25ceab670047040434303ec41f73e790c11b7c4 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 21 Nov 2006 16:34:16 +0000 Subject: [PATCH] small fix to DEBUG case in coalesce/freeGroup patch --- rts/sm/BlockAlloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rts/sm/BlockAlloc.c b/rts/sm/BlockAlloc.c index 1149260..763f2e7 100644 --- a/rts/sm/BlockAlloc.c +++ b/rts/sm/BlockAlloc.c @@ -227,9 +227,11 @@ coalesce(bdescr *p) { nat i, blocks; bdescr *bd; + blocks = q->blocks; // not strictly necessary to do this, but helpful if we have a // random ptr and want to figure out what block it belongs to. - for (i = 0, bd = q; i < q->blocks; bd++, i++) { + // Also required for sanity checking (see checkFreeListSanity()). + for (i = 0, bd = q; i < blocks; bd++, i++) { bd->free = 0; bd->blocks = 0; bd->link = p; -- 1.7.10.4