mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
sync rb_gc_register_mark_object()
rb_vm_t::mark_object_ary is global resource so we need to synchronize to access it.
This commit is contained in:
parent
e06f4a3b1f
commit
4a588e70b8
1 changed files with 11 additions and 7 deletions
4
gc.c
4
gc.c
|
|
@ -7346,6 +7346,8 @@ rb_gc_force_recycle(VALUE obj)
|
||||||
|
|
||||||
void
|
void
|
||||||
rb_gc_register_mark_object(VALUE obj)
|
rb_gc_register_mark_object(VALUE obj)
|
||||||
|
{
|
||||||
|
RB_VM_LOCK_ENTER();
|
||||||
{
|
{
|
||||||
VALUE ary_ary = GET_VM()->mark_object_ary;
|
VALUE ary_ary = GET_VM()->mark_object_ary;
|
||||||
VALUE ary = rb_ary_last(0, 0, ary_ary);
|
VALUE ary = rb_ary_last(0, 0, ary_ary);
|
||||||
|
|
@ -7357,6 +7359,8 @@ rb_gc_register_mark_object(VALUE obj)
|
||||||
|
|
||||||
rb_ary_push(ary, obj);
|
rb_ary_push(ary, obj);
|
||||||
}
|
}
|
||||||
|
RB_VM_LOCK_LEAVE();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rb_gc_register_address(VALUE *addr)
|
rb_gc_register_address(VALUE *addr)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue