diff options
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -2483,7 +2483,18 @@ gc_before_heap_sweep(rb_objspace_t *objspace, rb_heap_t *heap) heap->free_pages = NULL; if (heap->using_page) { - heap->using_page->freelist = heap->freelist; + if (heap->using_page->freelist) { + RVALUE *pstart = heap->using_page->freelist; + RVALUE *p = heap->using_page->freelist; + while (p->as.free.next) { + p = p->as.free.next; + } + p->as.free.next = heap->freelist; + heap->using_page->freelist = pstart; + } + else { + heap->using_page->freelist = heap->freelist; + } heap->using_page = NULL; } heap->freelist = NULL; |