1 /* -----------------------------------------------------------------------------
2 * $Id: BlockAlloc.h,v 1.2 1998/12/02 13:28:13 simonm Exp $
4 * Block Allocator Interface
6 * ---------------------------------------------------------------------------*/
11 /* Initialisation ---------------------------------------------------------- */
13 extern void initBlockAllocator(void);
15 /* Allocation -------------------------------------------------------------- */
17 extern bdescr *allocGroup(nat n);
18 extern bdescr *allocBlock(void);
20 /* De-Allocation ----------------------------------------------------------- */
22 extern void freeGroup(bdescr *p);
23 extern void freeChain(bdescr *p);
25 /* Finding the block descriptor for a given block -------------------------- */
27 static inline bdescr *Bdescr(StgPtr p)
30 ((((W_)p & MBLOCK_MASK & ~BLOCK_MASK) >> (BLOCK_SHIFT-BDESCR_SHIFT))
31 | ((W_)p & ~MBLOCK_MASK)
35 /* Debugging -------------------------------------------------------------- */
38 extern void checkFreeListSanity(void);