Skip to content

Commit

Permalink
Remove rb_objspace_marked_object_p
Browse files Browse the repository at this point in the history
rb_objspace_marked_object_p is no longer used in the objspace module, so
we can remove it.
  • Loading branch information
peterzhu2118 committed Feb 26, 2024
1 parent 7538703 commit 78ae6db
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
12 changes: 1 addition & 11 deletions gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6826,16 +6826,6 @@ rb_gc_remove_weak(VALUE parent_obj, VALUE *ptr)
}
}

/* CAUTION: THIS FUNCTION ENABLE *ONLY BEFORE* SWEEPING.
* This function is only for GC_END_MARK timing.
*/

int
rb_objspace_marked_object_p(VALUE obj)
{
return RVALUE_MARKED(obj) ? TRUE : FALSE;
}

static inline void
gc_mark_set_parent(rb_objspace_t *objspace, VALUE obj)
{
Expand Down Expand Up @@ -9606,7 +9596,7 @@ gc_move(rb_objspace_t *objspace, VALUE scan, VALUE free, size_t src_slot_size, s
GC_ASSERT(!RVALUE_MARKING((VALUE)src));

/* Save off bits for current object. */
marked = rb_objspace_marked_object_p((VALUE)src);
marked = RVALUE_MARKED((VALUE)src);
wb_unprotected = RVALUE_WB_UNPROTECTED((VALUE)src);
uncollectible = RVALUE_UNCOLLECTIBLE((VALUE)src);
bool remembered = RVALUE_REMEMBERED((VALUE)src);
Expand Down
1 change: 0 additions & 1 deletion internal/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ void rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), v
void rb_objspace_reachable_objects_from_root(void (func)(const char *category, VALUE, void *), void *data);
int rb_objspace_markable_object_p(VALUE obj);
int rb_objspace_internal_object_p(VALUE obj);
int rb_objspace_marked_object_p(VALUE obj);

void rb_objspace_each_objects(
int (*callback)(void *start, void *end, size_t stride, void *data),
Expand Down

0 comments on commit 78ae6db

Please sign in to comment.