1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

check it in eden or tomb.

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.
This commit is contained in:
Koichi Sasada 2019-05-24 17:35:22 +09:00
parent 10927b5925
commit 712c027524

2
gc.c
View file

@ -2207,9 +2207,11 @@ 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) {
if (!page->flags.in_tomb) {
RB_DEBUG_COUNTER_INC(gc_isptr_maybe);
return TRUE;
}
}
lo = mid + 1;
}
else {