/* -----------------------------------------------------------------------------
- * $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
*
static bdescr *allocMegaGroup(nat mblocks);
static void freeMegaGroup(bdescr *bd);
-static bdescr *free_list;
+static bdescr *free_list = NULL;
/* -----------------------------------------------------------------------------
Initialisation
void initBlockAllocator(void)
{
- free_list = NULL;
+ // The free list starts off NULL
}
/* -----------------------------------------------------------------------------
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);
}