summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-11-17 11:24:44 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-11-19 11:57:36 -0500
commiteb7b233a3db9f3958bdf8d8eb6c76c6d9f00f5b9 (patch)
tree1ce42cd41a0ba19b6903fd14fa9771add8bafffe
parent097f807214d5f4422a1d2cbacd8bc89908eddbdb (diff)
downloadhaskell-eb7b233a3db9f3958bdf8d8eb6c76c6d9f00f5b9.tar.gz
nonmoving: Fix handling on large object marking on 32-bit
Previously we would reset the pointer pointing to the object to be marked to the beginning of the block when marking a large object. This did no harm on 64-bit but on 32-bit it broke, e.g. `arr020`, since we align pinned ByteArray allocations such that the payload is 8 byte-aligned. This means that the object might not begin at the beginning of the block.,
-rw-r--r--rts/sm/NonMovingMark.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/rts/sm/NonMovingMark.c b/rts/sm/NonMovingMark.c
index 638be30c20..085d7827df 100644
--- a/rts/sm/NonMovingMark.c
+++ b/rts/sm/NonMovingMark.c
@@ -62,7 +62,13 @@ static void mark_PAP_payload (MarkQueue *queue,
* collector and moved to nonmoving_large_objects during the next major GC.
* When this happens the block gets its BF_NONMOVING_SWEEPING flag set to
* indicate that it is part of the snapshot and consequently should be marked by
- * the nonmoving mark phase..
+ * the nonmoving mark phase.
+ *
+ * Note that pinned object blocks are treated as large objects containing only
+ * a single object. That is, the block has a single mark flag (BF_MARKED) and we
+ * consequently will trace the pointers of only one object per block. However,
+ * this is okay since the only type of pinned object supported by GHC is the
+ * pinned ByteArray#, which has no pointers.
*/
bdescr *nonmoving_large_objects = NULL;
@@ -1281,9 +1287,6 @@ mark_closure (MarkQueue *queue, const StgClosure *p0, StgClosure **origin)
if (bd->flags & BF_MARKED) {
goto done;
}
-
- // Mark contents
- p = (StgClosure*)bd->start;
} else {
struct NonmovingSegment *seg = nonmovingGetSegment((StgPtr) p);
nonmoving_block_idx block_idx = nonmovingGetBlockIdx((StgPtr) p);