Revert "NonMovingScav: Account for new allocations" wip/gc/debug
authorBen Gamari <ben@smart-cactus.org>
Sun, 16 Jun 2019 19:01:30 +0000 (15:01 -0400)
committerBen Gamari <ben@smart-cactus.org>
Wed, 19 Jun 2019 01:44:02 +0000 (21:44 -0400)
This reverts commit ce36fd898436386c13468d41adaf6f11f2e9c7f1.

rts/sm/NonMovingScav.c

index da8236e..5c5019b 100644 (file)
@@ -373,12 +373,13 @@ scavengeNonmovingSegment (struct NonmovingSegment *seg)
     ASSERT(seg_block->u.scan >= (P_)nonmovingSegmentGetBlock(seg, 0));
     ASSERT(seg_block->u.scan <= (P_)nonmovingSegmentGetBlock(seg, seg->next_free));
 
-    nonmoving_block_idx p_idx = nonmovingGetBlockIdx(seg_block->u.scan);
-    if (p_idx == seg->next_free)
+    StgPtr scan_end = (P_)nonmovingSegmentGetBlock(seg, seg->next_free);
+    if (seg_block->u.scan == scan_end)
         return;
     trace_dump_note("scavenging segment");
 
-    while (p_idx < seg->next_free) {
+    nonmoving_block_idx p_idx = nonmovingGetBlockIdx(seg_block->u.scan);
+    while (seg_block->u.scan < scan_end) {
         StgClosure *p = (StgClosure*)seg_block->u.scan;
         trace_dump_set_source_closure(p);