mirror of
https://github.com/ruby/ruby.git
synced 2025-08-17 14:39:02 +02: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
2
gc.c
2
gc.c
|
@ -2207,9 +2207,11 @@ is_pointer_to_heap(rb_objspace_t *objspace, void *ptr)
|
||||||
page = heap_pages_sorted[mid];
|
page = heap_pages_sorted[mid];
|
||||||
if (page->start <= p) {
|
if (page->start <= p) {
|
||||||
if (p < page->start + page->total_slots) {
|
if (p < page->start + page->total_slots) {
|
||||||
|
if (!page->flags.in_tomb) {
|
||||||
RB_DEBUG_COUNTER_INC(gc_isptr_maybe);
|
RB_DEBUG_COUNTER_INC(gc_isptr_maybe);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
lo = mid + 1;
|
lo = mid + 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue