summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-03-16 15:13:32 -0400
committerPeter Zhu <peter@peterzhu.ca>2023-03-17 11:12:45 -0400
commita206ee670969ce213ec0da4d1d5b65d24259efd4 (patch)
tree9fa10ac47942a8dd41c896b8b75ece3cf6031103 /gc.c
parent11f299fab749bd2e0c5e49ca4db8c9c84b8e5970 (diff)
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.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/7545
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c6
1 files changed, 3 insertions, 3 deletions
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));