X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FBlock.h;h=d1705ad68650afddb9451d415d6f3d3db1c9a0b8;hb=28a464a75e14cece5db40f2765a29348273ff2d2;hp=37d17a50b3846d16c988cefc8d69a42857682a36;hpb=e7c3f957fd36fd9f6369183b7a31e2a4a4c21b43;p=ghc-hetmet.git diff --git a/ghc/includes/Block.h b/ghc/includes/Block.h index 37d17a5..d1705ad 100644 --- a/ghc/includes/Block.h +++ b/ghc/includes/Block.h @@ -1,5 +1,4 @@ /* ----------------------------------------------------------------------------- - * $Id: Block.h,v 1.18 2005/02/10 13:02:00 simonmar Exp $ * * (c) The GHC Team, 1998-1999 * @@ -57,7 +56,7 @@ typedef struct bdescr_ { StgWord *bitmap; } u; unsigned int gen_no; /* generation */ - struct _step *step; /* step */ + struct step_ *step; /* step */ StgWord32 blocks; /* no. of blocks (if grp head, 0 otherwise) */ StgWord32 flags; /* block is in to-space */ #if SIZEOF_VOID_P == 8 @@ -86,6 +85,8 @@ typedef struct bdescr_ { #define BF_PINNED 4 /* Block is part of a compacted generation */ #define BF_COMPACTED 8 +/* Block is free, and on the free list */ +#define BF_FREE 16 /* Finding the block descriptor for a given block -------------------------- */ @@ -143,7 +144,7 @@ INLINE_HEADER bdescr *Bdescr(StgPtr p) #ifndef CMINUSMINUS -// to the end... +/* to the end... */ /* Double-linked block lists: --------------------------------------------- */ @@ -164,13 +165,21 @@ extern void initBlockAllocator(void); /* Allocation -------------------------------------------------------------- */ -extern bdescr *allocGroup(nat n); -extern bdescr *allocBlock(void); +bdescr *allocGroup(nat n); +bdescr *allocBlock(void); + +// versions that take the storage manager lock for you: +bdescr *allocGroup_lock(nat n); +bdescr *allocBlock_lock(void); /* De-Allocation ----------------------------------------------------------- */ -extern void freeGroup(bdescr *p); -extern void freeChain(bdescr *p); +void freeGroup(bdescr *p); +void freeChain(bdescr *p); + +// versions that take the storage manager lock for you: +void freeGroup_lock(bdescr *p); +void freeChain_lock(bdescr *p); /* Round a value to megablocks --------------------------------------------- */