mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Don't pin objects if we're just walking the heap
Walking the heap can inadvertently pin objects. Only mark the object's pin bit if the mark_func_data pointer is NULL (similar to the mark bits)
This commit is contained in:
parent
1d637b1f5e
commit
3dc313a239
Notes:
git
2020-08-04 04:28:35 +09:00
1 changed files with 3 additions and 1 deletions
4
gc.c
4
gc.c
|
@ -5313,7 +5313,9 @@ gc_pin(rb_objspace_t *objspace, VALUE obj)
|
|||
{
|
||||
GC_ASSERT(is_markable_object(objspace, obj));
|
||||
if (UNLIKELY(objspace->flags.during_compacting)) {
|
||||
MARK_IN_BITMAP(GET_HEAP_PINNED_BITS(obj), obj);
|
||||
if (LIKELY(objspace->mark_func_data == NULL)) {
|
||||
MARK_IN_BITMAP(GET_HEAP_PINNED_BITS(obj), obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue