Skip to content

Commit

Permalink
check it in eden or tomb.
Browse files Browse the repository at this point in the history
is_pointer_to_heap() checks if it is in valid pointer to the
RVALUE in any heap_page_body. However, it returns true if it
points tomb pages. This patch check it points to eden pages.
  • Loading branch information
ko1 committed May 24, 2019
1 parent 10927b5 commit 712c027
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gc.c
Expand Up @@ -2207,8 +2207,10 @@ is_pointer_to_heap(rb_objspace_t *objspace, void *ptr)
page = heap_pages_sorted[mid];
if (page->start <= p) {
if (p < page->start + page->total_slots) {
RB_DEBUG_COUNTER_INC(gc_isptr_maybe);
return TRUE;
if (!page->flags.in_tomb) {
RB_DEBUG_COUNTER_INC(gc_isptr_maybe);
return TRUE;
}
}
lo = mid + 1;
}
Expand Down

0 comments on commit 712c027

Please sign in to comment.