Skip to content

Commit ebd13b5

Browse files
committed
Pin shape->edges
1 parent 1bce8ca commit ebd13b5

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

shape.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,14 @@ shape_tree_mark(void *data)
324324
rb_shape_t *end = RSHAPE(GET_SHAPE_TREE()->next_shape_id);
325325
while (cursor < end) {
326326
if (cursor->edges && !SINGLE_CHILD_P(cursor->edges)) {
327-
rb_gc_mark_movable(cursor->edges);
327+
// FIXME: GC compaction may call `rb_shape_traverse_from_new_root`
328+
// to migrate objects from one object slot to another.
329+
// Because of this if we don't pin `cursor->edges` it might be turned
330+
// into a T_MOVED during GC.
331+
// We'd need to eliminate `SHAPE_T_OBJECT` so that GC never need to lookup
332+
// shapes this way.
333+
// rb_gc_mark_movable(cursor->edges);
334+
rb_gc_mark(cursor->edges);
328335
}
329336
cursor++;
330337
}

0 commit comments

Comments
 (0)