From: simonmar Date: Mon, 30 Jul 2001 13:06:18 +0000 (+0000) Subject: [project @ 2001-07-30 13:06:18 by simonmar] X-Git-Tag: Approximately_9120_patches~1394 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=e2c87ca75e8f4833145c31a3b7b2ffeefeae7679;p=ghc-hetmet.git [project @ 2001-07-30 13:06:18 by simonmar] add definition of unmark() --- diff --git a/ghc/rts/GCCompact.h b/ghc/rts/GCCompact.h index 8244e87..4de4bf3 100644 --- a/ghc/rts/GCCompact.h +++ b/ghc/rts/GCCompact.h @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: GCCompact.h,v 1.1 2001/07/23 17:23:19 simonmar Exp $ + * $Id: GCCompact.h,v 1.2 2001/07/30 13:06:18 simonmar Exp $ * * (c) The GHC Team 1998-1999 * @@ -17,6 +17,16 @@ mark(StgPtr p, bdescr *bd) *bitmap_word |= bit_mask; } +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)); + *bitmap_word &= ~bit_mask; +} + static inline int is_marked(StgPtr p, bdescr *bd) {