Skip to content

Commit 031785b

Browse files
committed
Use rb_gc_obj_needs_cleanup_p
1 parent 08eaa81 commit 031785b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

gc/mmtk/mmtk.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,9 @@ rb_mmtk_call_obj_free(MMTk_ObjectReference object)
345345
pthread_mutex_unlock(&objspace->event_hook_mutex);
346346
}
347347

348-
rb_gc_obj_free(objspace, obj);
348+
if (RB_UNLIKELY(rb_gc_obj_needs_cleanup_p(obj))) {
349+
rb_gc_obj_free(objspace, obj);
350+
}
349351

350352
#ifdef MMTK_DEBUG
351353
memset((void *)obj, 0, rb_gc_impl_obj_slot_size(obj));

0 commit comments

Comments
 (0)