X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FBlockAlloc.c;h=8e09d0cc5ccdbf2a1b22b4ee4619cf613f08b812;hb=d891bb5c04f53b2cce4ac8f462300ed6ecc6c4a2;hp=9d13719918c13fe974f07695a9f0d811200945ce;hpb=7457757f193b28b5fe8fee01edbed012c2fda897;p=ghc-hetmet.git diff --git a/ghc/rts/BlockAlloc.c b/ghc/rts/BlockAlloc.c index 9d13719..8e09d0c 100644 --- a/ghc/rts/BlockAlloc.c +++ b/ghc/rts/BlockAlloc.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: BlockAlloc.c,v 1.14 2002/07/17 09:21:49 simonmar Exp $ + * $Id: BlockAlloc.c,v 1.16 2003/02/18 05:47:53 sof Exp $ * * (c) The GHC Team 1998-2000 * @@ -29,7 +29,7 @@ static void initMBlock(void *mblock); static bdescr *allocMegaGroup(nat mblocks); static void freeMegaGroup(bdescr *bd); -static bdescr *free_list; +static bdescr *free_list = NULL; /* ----------------------------------------------------------------------------- Initialisation @@ -37,7 +37,7 @@ static bdescr *free_list; void initBlockAllocator(void) { - free_list = NULL; + // The free list starts off NULL } /* ----------------------------------------------------------------------------- @@ -265,7 +265,7 @@ freeMegaGroup(bdescr *p) n = p->blocks * BLOCK_SIZE / MBLOCK_SIZE + 1; for (; n > 0; (W_)p += MBLOCK_SIZE, n--) { - initMBlock((void *)((W_)p & ~MBLOCK_MASK)); + initMBlock(MBLOCK_ROUND_DOWN(p)); initGroup(BLOCKS_PER_MBLOCK, p); freeGroup(p); }