projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2003-07-10 08:11:36 by simonpj]
[ghc-hetmet.git]
/
ghc
/
rts
/
BlockAlloc.c
diff --git
a/ghc/rts/BlockAlloc.c
b/ghc/rts/BlockAlloc.c
index
f33ab86
..
8e09d0c
100644
(file)
--- a/
ghc/rts/BlockAlloc.c
+++ b/
ghc/rts/BlockAlloc.c
@@
-1,5
+1,5
@@
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
- * $Id: BlockAlloc.c,v 1.13 2001/11/08 14:42:11 simonmar Exp $
+ * $Id: BlockAlloc.c,v 1.16 2003/02/18 05:47:53 sof Exp $
*
* (c) The GHC Team 1998-2000
*
*
* (c) The GHC Team 1998-2000
*
@@
-23,11
+23,13
@@
#include "BlockAlloc.h"
#include "MBlock.h"
#include "BlockAlloc.h"
#include "MBlock.h"
+#include <string.h>
+
static void initMBlock(void *mblock);
static bdescr *allocMegaGroup(nat mblocks);
static void freeMegaGroup(bdescr *bd);
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
/* -----------------------------------------------------------------------------
Initialisation
@@
-35,7
+37,7
@@
static bdescr *free_list;
void initBlockAllocator(void)
{
void initBlockAllocator(void)
{
- free_list = NULL;
+ // The free list starts off NULL
}
/* -----------------------------------------------------------------------------
}
/* -----------------------------------------------------------------------------
@@
-263,7
+265,7
@@
freeMegaGroup(bdescr *p)
n = p->blocks * BLOCK_SIZE / MBLOCK_SIZE + 1;
for (; n > 0; (W_)p += MBLOCK_SIZE, n--) {
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);
}
initGroup(BLOCKS_PER_MBLOCK, p);
freeGroup(p);
}