aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gc.c b/gc.c
index 7b4fa0e15a..afea8aa259 100644
--- a/gc.c
+++ b/gc.c
@@ -2168,12 +2168,8 @@ is_id_value(rb_objspace_t *objspace, VALUE ptr)
static inline int
heap_is_swept_object(rb_objspace_t *objspace, rb_heap_t *heap, VALUE ptr)
{
- struct heap_page *page = heap->sweep_pages;
- while (page) {
- if ((VALUE)page->start <= ptr && ptr < (VALUE)(page->start + page->limit)) return FALSE;
- page = page->next;
- }
- return TRUE;
+ struct heap_page *page = GET_HEAP_PAGE(ptr);
+ return page->before_sweep ? FALSE : TRUE;
}
static inline int