8000 Pin shape->edges · ruby/ruby@db2cfeb · GitHub
[go: up one dir, main page]

Skip to content

Commit db2cfeb

Browse files
committed
Pin shape->edges
1 parent e9fd44d commit db2cfeb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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 l 57A4 ookup
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)
0