X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FGCCompact.h;h=711b57b62c1b7345d1e7c784fc6da93c619cfc41;hb=fa9a03c15ad5ba9f05b90026031933da10a08fd8;hp=8244e87c4544bd66f4ae6ac6d8c9acc74a9d3b35;hpb=dfd7d6d02a597949b08161ae3d49dc6dfc9e812d;p=ghc-hetmet.git diff --git a/ghc/rts/GCCompact.h b/ghc/rts/GCCompact.h index 8244e87..711b57b 100644 --- a/ghc/rts/GCCompact.h +++ b/ghc/rts/GCCompact.h @@ -1,5 +1,4 @@ /* ----------------------------------------------------------------------------- - * $Id: GCCompact.h,v 1.1 2001/07/23 17:23:19 simonmar Exp $ * * (c) The GHC Team 1998-1999 * @@ -7,7 +6,7 @@ * * ---------------------------------------------------------------------------*/ -static inline void +INLINE_HEADER void mark(StgPtr p, bdescr *bd) { nat offset_within_block = p - bd->start; // in words @@ -17,7 +16,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