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
|
||||
undefine_final(VALUE os, VALUE obj)
|
||||
{
|
||||
rb_check_frozen(obj);
|
||||
|
||||
rb_gc_impl_undefine_finalizer(rb_gc_get_objspace(), obj);
|
||||
|
||||
return obj;
|
||||
|
@ -3005,8 +3005,10 @@ void
|
||||
rb_gc_impl_undefine_finalizer(void *objspace_ptr, VALUE obj)
|
||||
{
|
||||
rb_objspace_t *objspace = objspace_ptr;
|
||||
|
||||
GC_ASSERT(!OBJ_FROZEN(obj));
|
||||
|
||||
st_data_t data = obj;
|
||||
rb_check_frozen(obj);
|
||||
st_delete(finalizer_table, &data, 0);
|
||||
FL_UNSET(obj, FL_FINALIZE);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user