From a206ee670969ce213ec0da4d1d5b65d24259efd4 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 16 Mar 2023 15:13:32 -0400 Subject: Assume that FL_FINALIZE is in finalizer_table If the flag FL_FINALIZE is set, then it's guaranteed to be in the finalizer_table, so we can directly assume that without checking. --- gc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gc.c') diff --git a/gc.c b/gc.c index 151258db39..c269d7fce0 100644 --- a/gc.c +++ b/gc.c @@ -9861,9 +9861,9 @@ gc_is_moveable_obj(rb_objspace_t *objspace, VALUE obj) * prevent the objects from being collected. This check prevents * objects that are keys in the finalizer table from being moved * without directly pinning them. */ - if (st_is_member(finalizer_table, obj)) { - return FALSE; - } + GC_ASSERT(st_is_member(finalizer_table, obj)); + + return FALSE; } GC_ASSERT(RVALUE_MARKED(obj)); GC_ASSERT(!RVALUE_PINNED(obj)); -- cgit v1.2.3