From edc7b73fc4755bb91ea16d1513993fbce5a6e244 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Tue, 27 Feb 2024 14:36:19 -0500 Subject: [PATCH] Remove pointer check in moved_or_living_object_strictly_p We don't need to check that the object is pointer to the GC heap in moved_or_living_object_strictly_p because it is called during reference updating, which does not free pages so it can never point to an object that is not on the GC heap. --- imemo.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/imemo.c b/imemo.c index 9bda0390071d06..66428f39b40f30 100644 --- a/imemo.c +++ b/imemo.c @@ -215,9 +215,7 @@ rb_cc_table_mark(VALUE klass) static bool moved_or_living_object_strictly_p(VALUE obj) { - return obj && - rb_gc_is_ptr_to_obj((void *)obj) && - (rb_objspace_markable_object_p(obj) || BUILTIN_TYPE(obj) == T_MOVED); + return obj && (rb_objspace_markable_object_p(obj) || BUILTIN_TYPE(obj) == T_MOVED); } static void