summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-03-04 19:39:43 -0500
committerBen Gamari <ben@smart-cactus.org>2020-03-04 20:02:03 -0500
commit6745cc8b6a2b53ec6d774a30f1bb6477df754d51 (patch)
tree264ba132020a35b1739e756dfb8b07e58c05f897
parent0d24e32ea53be2b64fcf6c243ac08b875fd6519e (diff)
downloadhaskell-6745cc8b6a2b53ec6d774a30f1bb6477df754d51.tar.gz
nonmoving: Remove redundant bitmap clearing
nonmovingSweep already clears the bitmap in the sweep loop. There is no reason to do so a second time.
-rw-r--r--rts/sm/NonMovingSweep.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/rts/sm/NonMovingSweep.c b/rts/sm/NonMovingSweep.c
index 44657148b8..89efe8f1ad 100644
--- a/rts/sm/NonMovingSweep.c
+++ b/rts/sm/NonMovingSweep.c
@@ -26,7 +26,8 @@ enum SweepResult {
};
// Determine which list a marked segment should be placed on and initialize
-// next_free indices as appropriate.
+// next_free indices as appropriate. Additionally, we must clear the mark
+// bitmap entries associated with swept blocks.
GNUC_ATTR_HOT static enum SweepResult
nonmovingSweepSegment(struct NonmovingSegment *seg)
{
@@ -40,6 +41,8 @@ nonmovingSweepSegment(struct NonmovingSegment *seg)
if (seg->bitmap[i] == nonmovingMarkEpoch) {
found_live = true;
} else if (!found_free) {
+ // This is the first free block we've found; set next_free,
+ // next_free_snap, and the scan pointer.
found_free = true;
seg->next_free = i;
nonmovingSegmentInfo(seg)->next_free_snap = i;
@@ -65,7 +68,6 @@ nonmovingSweepSegment(struct NonmovingSegment *seg)
} else {
ASSERT(seg->next_free == 0);
ASSERT(nonmovingSegmentInfo(seg)->next_free_snap == 0);
- nonmovingClearBitmap(seg);
return SEGMENT_FREE;
}
}