[project @ 2004-02-07 16:37:06 by panne]
[ghc-hetmet.git] / ghc / rts / GCCompact.h
index 8244e87..c709937 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: GCCompact.h,v 1.1 2001/07/23 17:23:19 simonmar Exp $
+ * $Id: GCCompact.h,v 1.3 2003/11/12 17:49:07 sof Exp $
  *
  * (c) The GHC Team 1998-1999
  *
@@ -7,7 +7,7 @@
  *
  * ---------------------------------------------------------------------------*/
 
-static inline void 
+INLINE_HEADER void 
 mark(StgPtr p, bdescr *bd)
 {
     nat offset_within_block = p - bd->start; // in words
@@ -17,7 +17,17 @@ mark(StgPtr p, bdescr *bd)
     *bitmap_word |= bit_mask;
 }
 
-static inline int
+INLINE_HEADER void 
+unmark(StgPtr p, bdescr *bd)
+{
+    nat offset_within_block = p - bd->start; // in words
+    StgPtr bitmap_word = (StgPtr)bd->u.bitmap + 
+       (offset_within_block / (sizeof(W_)*BITS_PER_BYTE));
+    nat bit_mask = 1 << (offset_within_block & (sizeof(W_)*BITS_PER_BYTE - 1));
+    *bitmap_word &= ~bit_mask;
+}
+
+INLINE_HEADER int
 is_marked(StgPtr p, bdescr *bd)
 {
     nat offset_within_block = p - bd->start; // in words