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:
Koichi Sasada 2019-05-23 16:52:14 +09:00
Родитель 65637dae30
Коммит 6be0ab73c3
1 изменённых файлов: 6 добавлений и 7 удалений

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