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:
parent
10927b5925
commit
712c027524
1 changed files with 4 additions and 2 deletions
6
gc.c
6
gc.c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue