X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FGCCompact.h;h=0fb39b3b12d647abd70310f40c2eb08371f64a8d;hb=45252b35151fc55aa19fb6770df5ed8267639083;hp=711b57b62c1b7345d1e7c784fc6da93c619cfc41;hpb=94e06463420582cc2d336b39a297e82af39e4cc4;p=ghc-hetmet.git diff --git a/ghc/rts/GCCompact.h b/ghc/rts/GCCompact.h index 711b57b..0fb39b3 100644 --- a/ghc/rts/GCCompact.h +++ b/ghc/rts/GCCompact.h @@ -1,39 +1,44 @@ /* ----------------------------------------------------------------------------- * - * (c) The GHC Team 1998-1999 + * (c) The GHC Team 1998-2005 * * Compacting garbage collector * * ---------------------------------------------------------------------------*/ -INLINE_HEADER void +#ifndef GCCOMPACT_H +#define GCCOMPACT_H + +STATIC_INLINE void mark(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)); + StgWord bit_mask = (StgWord)1 << (offset_within_block & (sizeof(W_)*BITS_PER_BYTE - 1)); *bitmap_word |= bit_mask; } -INLINE_HEADER void +STATIC_INLINE 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)); + StgWord bit_mask = (StgWord)1 << (offset_within_block & (sizeof(W_)*BITS_PER_BYTE - 1)); *bitmap_word &= ~bit_mask; } -INLINE_HEADER int +STATIC_INLINE StgWord is_marked(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)); + StgWord bit_mask = (StgWord)1 << (offset_within_block & (sizeof(W_)*BITS_PER_BYTE - 1)); return (*bitmap_word & bit_mask); } void compact( void (*get_roots)(evac_fn) ); + +#endif /* GCCOMPACT_H */