diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-03-04 19:39:43 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-03-14 05:29:18 -0400 |
commit | fdfa2d0121ca8cc22479dd17a74afa58fc2b39f5 (patch) | |
tree | 57bcc033421c6124f549abcc921a858c2442427c | |
parent | 20d4d676964382b313b9e44062e45a7c38621999 (diff) | |
download | haskell-fdfa2d0121ca8cc22479dd17a74afa58fc2b39f5.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.c | 6 |
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; } } |