summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rts/sm/Compact.h12
-rw-r--r--rts/sm/GC.c4
2 files changed, 8 insertions, 8 deletions
diff --git a/rts/sm/Compact.h b/rts/sm/Compact.h
index 6dcb50b1aa..63abfc7180 100644
--- a/rts/sm/Compact.h
+++ b/rts/sm/Compact.h
@@ -20,8 +20,8 @@ mark(StgPtr p, bdescr *bd)
{
uint32_t offset_within_block = p - bd->start; // in words
StgPtr bitmap_word = (StgPtr)bd->u.bitmap +
- (offset_within_block / (sizeof(W_)*BITS_PER_BYTE));
- StgWord bit_mask = (StgWord)1 << (offset_within_block & (sizeof(W_)*BITS_PER_BYTE - 1));
+ (offset_within_block / BITS_IN(W_));
+ StgWord bit_mask = (StgWord)1 << (offset_within_block & (BITS_IN(W_) - 1));
*bitmap_word |= bit_mask;
}
@@ -30,8 +30,8 @@ unmark(StgPtr p, bdescr *bd)
{
uint32_t offset_within_block = p - bd->start; // in words
StgPtr bitmap_word = (StgPtr)bd->u.bitmap +
- (offset_within_block / (sizeof(W_)*BITS_PER_BYTE));
- StgWord bit_mask = (StgWord)1 << (offset_within_block & (sizeof(W_)*BITS_PER_BYTE - 1));
+ (offset_within_block / BITS_IN(W_));
+ StgWord bit_mask = (StgWord)1 << (offset_within_block & (BITS_IN(W_) - 1));
*bitmap_word &= ~bit_mask;
}
@@ -40,8 +40,8 @@ is_marked(StgPtr p, bdescr *bd)
{
uint32_t offset_within_block = p - bd->start; // in words
StgPtr bitmap_word = (StgPtr)bd->u.bitmap +
- (offset_within_block / (sizeof(W_)*BITS_PER_BYTE));
- StgWord bit_mask = (StgWord)1 << (offset_within_block & (sizeof(W_)*BITS_PER_BYTE - 1));
+ (offset_within_block / BITS_IN(W_));
+ StgWord bit_mask = (StgWord)1 << (offset_within_block & (BITS_IN(W_)- 1));
return (*bitmap_word & bit_mask);
}
diff --git a/rts/sm/GC.c b/rts/sm/GC.c
index 197b46657b..54797ba0f0 100644
--- a/rts/sm/GC.c
+++ b/rts/sm/GC.c
@@ -1372,7 +1372,7 @@ prepare_collected_gen (generation *gen)
bdescr *bitmap_bdescr;
StgWord *bitmap;
- bitmap_size = gen->n_old_blocks * BLOCK_SIZE / (sizeof(W_)*BITS_PER_BYTE);
+ bitmap_size = gen->n_old_blocks * BLOCK_SIZE / BITS_IN(W_);
if (bitmap_size > 0) {
bitmap_bdescr = allocGroup((StgWord)BLOCK_ROUND_UP(bitmap_size)
@@ -1390,7 +1390,7 @@ prepare_collected_gen (generation *gen)
// block descriptor.
for (bd=gen->old_blocks; bd != NULL; bd = bd->link) {
bd->u.bitmap = bitmap;
- bitmap += BLOCK_SIZE_W / (sizeof(W_)*BITS_PER_BYTE);
+ bitmap += BLOCK_SIZE_W / BITS_IN(W_);
// Also at this point we set the BF_MARKED flag
// for this block. The invariant is that