summaryrefslogtreecommitdiff
path: root/rts/sm/NonMoving.c
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-05-17 13:38:36 -0400
committerBen Gamari <ben@smart-cactus.org>2019-10-22 12:20:37 -0400
commitdd8d1b4928a9f82d2abfe0926c9ef3b5a20758b5 (patch)
treed649be6c5a49919f4103e557dedaf5eaa015a705 /rts/sm/NonMoving.c
parent6dcef5eedaee9a9ecd8b0e41c5f5b93512e6f6c9 (diff)
downloadhaskell-wip/gc/segment-header-to-bdescr.tar.gz
NonMoving: Move next_free_snap to block descriptorwip/gc/segment-header-to-bdescr
Diffstat (limited to 'rts/sm/NonMoving.c')
-rw-r--r--rts/sm/NonMoving.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/rts/sm/NonMoving.c b/rts/sm/NonMoving.c
index 5a6b9e7837..95a6fb1273 100644
--- a/rts/sm/NonMoving.c
+++ b/rts/sm/NonMoving.c
@@ -208,9 +208,9 @@ static void nonmovingInitSegment(struct NonmovingSegment *seg, uint8_t log_block
seg->link = NULL;
seg->todo_link = NULL;
seg->next_free = 0;
- seg->next_free_snap = 0;
nonmovingClearBitmap(seg);
bd->nonmoving_segment.log_block_size = log_block_size;
+ bd->nonmoving_segment.next_free_snap = 0;
bd->u.scan = nonmovingSegmentGetBlock(seg, 0);
}
@@ -386,7 +386,7 @@ void *nonmovingAllocate(Capability *cap, StgWord sz)
// Update live data estimate.
// See Note [Live data accounting in nonmoving collector].
- unsigned int new_blocks = block_count - current->next_free_snap;
+ unsigned int new_blocks = block_count - nonmovingSegmentInfo(current)->next_free_snap;
unsigned int block_size = 1 << log_block_size;
atomic_inc(&oldest_gen->live_estimate, new_blocks * block_size / sizeof(W_));
@@ -530,7 +530,7 @@ static void nonmovingPrepareMark(void)
// Update current segments' snapshot pointers
for (uint32_t cap_n = 0; cap_n < n_capabilities; ++cap_n) {
struct NonmovingSegment *seg = alloca->current[cap_n];
- seg->next_free_snap = seg->next_free;
+ nonmovingSegmentInfo(seg)->next_free_snap = seg->next_free;
}
// Update filled segments' snapshot pointers and move to sweep_list
@@ -546,7 +546,7 @@ static void nonmovingPrepareMark(void)
prefetchForWrite(seg->link->bitmap);
nonmovingClearBitmap(seg);
// Set snapshot
- seg->next_free_snap = seg->next_free;
+ nonmovingSegmentInfo(seg)->next_free_snap = seg->next_free;
if (seg->link)
seg = seg->link;
else