We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31a79fa commit d95568bCopy full SHA for d95568b
1 file changed
gc/default/default.c
@@ -1589,8 +1589,14 @@ rb_gc_impl_object_id(void *objspace_ptr, VALUE obj)
1589
}
1590
1591
if (rb_shape_has_object_id(shape)) {
1592
+ // We could avoid locking if the object isn't shareable
1593
+ lock_lev = rb_gc_vm_lock();
1594
+
1595
rb_shape_t *object_id_shape = rb_shape_object_id_shape(obj);
- return rb_ivar_at(obj, object_id_shape);
1596
+ id = rb_ivar_at(obj, object_id_shape);
1597
1598
+ rb_gc_vm_unlock(lock_lev);
1599
+ return id;
1600
1601
else {
1602
// We could avoid locking if the object isn't shareable
0 commit comments