Skip to content

Commit

Permalink
Remove pointer check in moved_or_living_object_strictly_p
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
peterzhu2118 committed Feb 27, 2024
1 parent 7c4bf61 commit edc7b73
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions imemo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit edc7b73

Please sign in to comment.