diff options
author | Koichi Sasada <ko1@atdot.net> | 2019-05-28 11:41:03 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2019-05-28 11:44:08 +0900 |
commit | 2229acaa54e1011ae77710e10f8c9e7933403127 (patch) | |
tree | 873ac0b81f77fe3ce539592f9f2968ac6e52a5b6 /gc.c | |
parent | 72333286c45ac821e227ad62d810a09a0208ecbb (diff) |
should use heap_eden->total_pages.
The size of page_list is heap_eden->total_pages, but
init_cursors() assumes the size of page_list is `heap_allocated_pages`.
This patch fix it.
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -7496,6 +7496,7 @@ static void init_cursors(rb_objspace_t *objspace, struct heap_cursor *free, struct heap_cursor *scan, struct heap_page **page_list) { struct heap_page *page; + size_t total_pages = heap_eden->total_pages; page = page_list[0]; free->index = 0; @@ -7503,8 +7504,8 @@ init_cursors(rb_objspace_t *objspace, struct heap_cursor *free, struct heap_curs free->slot = page->start; free->objspace = objspace; - page = page_list[heap_allocated_pages - 1]; - scan->index = heap_allocated_pages - 1; + page = page_list[total_pages - 1]; + scan->index = total_pages - 1; scan->page = page; scan->slot = page->start + page->total_slots - 1; scan->objspace = objspace; |