Move frozen check out of rb_gc_impl_undefine_finalizer
This commit is contained in:
parent
4b05d2dbb0
commit
51505f70e3
Notes:
git
2024-07-19 12:53:50 +00:00
2
gc.c
2
gc.c
@ -1448,6 +1448,8 @@ os_each_obj(int argc, VALUE *argv, VALUE os)
|
|||||||
static VALUE
|
static VALUE
|
||||||
undefine_final(VALUE os, VALUE obj)
|
undefine_final(VALUE os, VALUE obj)
|
||||||
{
|
{
|
||||||
|
rb_check_frozen(obj);
|
||||||
|
|
||||||
rb_gc_impl_undefine_finalizer(rb_gc_get_objspace(), obj);
|
rb_gc_impl_undefine_finalizer(rb_gc_get_objspace(), obj);
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
|
@ -3005,8 +3005,10 @@ void
|
|||||||
rb_gc_impl_undefine_finalizer(void *objspace_ptr, VALUE obj)
|
rb_gc_impl_undefine_finalizer(void *objspace_ptr, VALUE obj)
|
||||||
{
|
{
|
||||||
rb_objspace_t *objspace = objspace_ptr;
|
rb_objspace_t *objspace = objspace_ptr;
|
||||||
|
|
||||||
|
GC_ASSERT(!OBJ_FROZEN(obj));
|
||||||
|
|
||||||
st_data_t data = obj;
|
st_data_t data = obj;
|
||||||
rb_check_frozen(obj);
|
|
||||||
st_delete(finalizer_table, &data, 0);
|
st_delete(finalizer_table, &data, 0);
|
||||||
FL_UNSET(obj, FL_FINALIZE);
|
FL_UNSET(obj, FL_FINALIZE);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user