summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2024-02-26 15:47:48 -0500
committerPeter Zhu <peter@peterzhu.ca>2024-02-27 12:10:48 -0500
commit1f740cd1115fd96d5da7e7c08223de5396e8b5f1 (patch)
tree570807e0aeed1370ef174f369713637b6f54669c /gc.c
parentf67c9d001aefef26584b2d64c913240f0459f90b (diff)
Remove is_swept_object
The name is misleading, as it seems like the function checks whether the object is swept or not. But the function only checks whether the page is before or after sweeping.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/gc.c b/gc.c
index 8fdf96503a..cb5dbaee59 100644
--- a/gc.c
+++ b/gc.c
@@ -4372,19 +4372,12 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
ATOMIC_SET(finalizing, 0);
}
-static inline int
-is_swept_object(VALUE ptr)
-{
- struct heap_page *page = GET_HEAP_PAGE(ptr);
- return page->flags.before_sweep ? FALSE : TRUE;
-}
-
/* garbage objects will be collected soon. */
static inline int
is_garbage_object(rb_objspace_t *objspace, VALUE ptr)
{
if (!is_lazy_sweeping(objspace) ||
- is_swept_object(ptr) ||
+ !GET_HEAP_PAGE(ptr)->flags.before_sweep ||
MARKED_IN_BITMAP(GET_HEAP_MARK_BITS(ptr), ptr)) {
return FALSE;
@@ -13570,7 +13563,7 @@ rb_gcdebug_print_obj_condition(VALUE obj)
if (is_lazy_sweeping(objspace)) {
fprintf(stderr, "lazy sweeping?: true\n");
- fprintf(stderr, "swept?: %s\n", is_swept_object(obj) ? "done" : "not yet");
+ fprintf(stderr, "page swept?: %s\n", GET_HEAP_PAGE(ptr)->flags.before_sweep ? "false" : "true");
}
else {
fprintf(stderr, "lazy sweeping?: false\n");