diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-03-04 19:39:43 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-03-04 19:42:38 -0500 |
commit | 184f70ede9fa5107aa42d95a72e89e9d7c3541d4 (patch) | |
tree | 89acee00ef12980a10aea2a498079318740f3efd | |
parent | 2a2f51d79f145e015cc089d97cf71c19dd27bee4 (diff) | |
download | haskell-wip/gc/bitmap-clearing.tar.gz |
nonmoving: Remove redundant bitmap clearingwip/gc/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; } } |