зеркало из https://github.com/github/ruby.git
gc_pin() doesn't check is_markable_object().
Caller of gc_pin() should check it is a mark-able object. So gc_pin() doesn't need to check it. With this fix, we can refactoring around it.
This commit is contained in:
Родитель
65637dae30
Коммит
6be0ab73c3
13
gc.c
13
gc.c
|
@ -4693,8 +4693,7 @@ gc_mark_maybe(rb_objspace_t *objspace, VALUE obj)
|
|||
case T_NONE:
|
||||
break;
|
||||
default:
|
||||
gc_pin(objspace, obj);
|
||||
gc_mark_ptr(objspace, obj);
|
||||
gc_mark_and_pin(objspace, obj);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -4844,18 +4843,18 @@ gc_mark_ptr(rb_objspace_t *objspace, VALUE obj)
|
|||
}
|
||||
|
||||
static inline void
|
||||
gc_mark_and_pin(rb_objspace_t *objspace, VALUE obj)
|
||||
gc_pin(rb_objspace_t *objspace, VALUE obj)
|
||||
{
|
||||
if (!is_markable_object(objspace, obj)) return;
|
||||
GC_ASSERT(is_markable_object(objspace, obj));
|
||||
MARK_IN_BITMAP(GET_HEAP_PINNED_BITS(obj), obj);
|
||||
gc_mark_ptr(objspace, obj);
|
||||
}
|
||||
|
||||
static inline void
|
||||
gc_pin(rb_objspace_t *objspace, VALUE obj)
|
||||
gc_mark_and_pin(rb_objspace_t *objspace, VALUE obj)
|
||||
{
|
||||
if (!is_markable_object(objspace, obj)) return;
|
||||
MARK_IN_BITMAP(GET_HEAP_PINNED_BITS(obj), obj);
|
||||
gc_pin(objspace, obj);
|
||||
gc_mark_ptr(objspace, obj);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
Загрузка…
Ссылка в новой задаче