[project @ 2003-12-10 11:35:24 by wolfgang]
[ghc-hetmet.git] / ghc / includes / Block.h
index 55cb18a..ac30e8c 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Block.h,v 1.12 2003/03/25 16:19:56 sof Exp $
+ * $Id: Block.h,v 1.16 2003/11/26 12:14:26 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -76,12 +76,18 @@ typedef struct _bdescr {
 #define BDESCR_SHIFT 5
 #endif
 
+// Block contains objects evacuated during this GC
 #define BF_EVACUATED 1
+// Block is a large object
 #define BF_LARGE     2
+// Block is pinned
+#define BF_PINNED    4
+// Block is part of a compacted generation
+#define BF_COMPACTED 8
 
 /* Finding the block descriptor for a given block -------------------------- */
 
-static inline bdescr *Bdescr(StgPtr p)
+INLINE_HEADER bdescr *Bdescr(StgPtr p)
 {
   return (bdescr *)
     ((((W_)p &  MBLOCK_MASK & ~BLOCK_MASK) >> (BLOCK_SHIFT-BDESCR_SHIFT)) 
@@ -94,7 +100,7 @@ static inline bdescr *Bdescr(StgPtr p)
 /* Offset of first real data block in a megablock */
 
 #define FIRST_BLOCK_OFF \
-   ((W_)BLOCK_ROUND_UP(MBLOCK_SIZE / BLOCK_SIZE * BDESCR_SIZE))
+   ((W_)BLOCK_ROUND_UP(BDESCR_SIZE * (MBLOCK_SIZE / BLOCK_SIZE)))
 
 /* First data block in a given megablock */