mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Pin shape->edges
This commit is contained in:
parent
e9fd44dd72
commit
db2cfebff1
Notes:
git
2025-06-02 15:50:07 +00:00
1 changed files with 8 additions and 1 deletions
9
shape.c
9
shape.c
|
@ -324,7 +324,14 @@ shape_tree_mark(void *data)
|
||||||
rb_shape_t *end = RSHAPE(GET_SHAPE_TREE()->next_shape_id);
|
rb_shape_t *end = RSHAPE(GET_SHAPE_TREE()->next_shape_id);
|
||||||
while (cursor < end) {
|
while (cursor < end) {
|
||||||
if (cursor->edges && !SINGLE_CHILD_P(cursor->edges)) {
|
if (cursor->edges && !SINGLE_CHILD_P(cursor->edges)) {
|
||||||
rb_gc_mark_movable(cursor->edges);
|
// FIXME: GC compaction may call `rb_shape_traverse_from_new_root`
|
||||||
|
// to migrate objects from one object slot to another.
|
||||||
|
// Because of this if we don't pin `cursor->edges` it might be turned
|
||||||
|
// into a T_MOVED during GC.
|
||||||
|
// We'd need to eliminate `SHAPE_T_OBJECT` so that GC never need to lookup
|
||||||
|
// shapes this way.
|
||||||
|
// rb_gc_mark_movable(cursor->edges);
|
||||||
|
rb_gc_mark(cursor->edges);
|
||||||
}
|
}
|
||||||
cursor++;
|
cursor++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue