X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=inline;f=ghc%2Fincludes%2FBlock.h;h=f6a695c366abd0160c134c706229e055395619ce;hb=e87d56ce33f663da1c445f37e95c40d814caa384;hp=c665583ee47474dcad043585c37c2b6b290cf41f;hpb=21462c00b3241f15de3b145ac92ee5b266b5733a;p=ghc-hetmet.git diff --git a/ghc/includes/Block.h b/ghc/includes/Block.h index c665583..f6a695c 100644 --- a/ghc/includes/Block.h +++ b/ghc/includes/Block.h @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Block.h,v 1.5 1999/03/02 19:44:07 sof Exp $ + * $Id: Block.h,v 1.6 1999/11/09 15:47:07 simonmar Exp $ * * (c) The GHC Team, 1998-1999 * @@ -66,6 +66,16 @@ typedef struct _bdescr { #define BDESCR_SHIFT 5 #endif +/* Finding the block descriptor for a given block -------------------------- */ + +static inline bdescr *Bdescr(StgPtr p) +{ + return (bdescr *) + ((((W_)p & MBLOCK_MASK & ~BLOCK_MASK) >> (BLOCK_SHIFT-BDESCR_SHIFT)) + | ((W_)p & ~MBLOCK_MASK) + ); +} + /* Useful Macros ------------------------------------------------------------ */ /* Offset of first real data block in a megablock */