зеркало из https://github.com/github/ruby.git
Move empty pages to the tomb
I think we need to be moving empty pages to the tomb after they become empty.
This commit is contained in:
Родитель
0a2f04e156
Коммит
058db33c5e
13
gc.c
13
gc.c
|
@ -8397,10 +8397,6 @@ gc_compact_after_gc(rb_objspace_t *objspace, int use_toward_empty, int use_doubl
|
||||||
heap_eden->free_pages = NULL;
|
heap_eden->free_pages = NULL;
|
||||||
heap_eden->using_page = NULL;
|
heap_eden->using_page = NULL;
|
||||||
|
|
||||||
if (use_verifier) {
|
|
||||||
gc_verify_internal_consistency(objspace);
|
|
||||||
}
|
|
||||||
|
|
||||||
while (moved_list) {
|
while (moved_list) {
|
||||||
VALUE next_moved;
|
VALUE next_moved;
|
||||||
struct heap_page *page;
|
struct heap_page *page;
|
||||||
|
@ -8413,10 +8409,19 @@ gc_compact_after_gc(rb_objspace_t *objspace, int use_toward_empty, int use_doubl
|
||||||
RMOVED(moved_list)->next = 0;
|
RMOVED(moved_list)->next = 0;
|
||||||
page->free_slots++;
|
page->free_slots++;
|
||||||
heap_page_add_freeobj(objspace, page, moved_list);
|
heap_page_add_freeobj(objspace, page, moved_list);
|
||||||
|
if (page->free_slots == page->total_slots) {
|
||||||
|
heap_pages_freeable_pages--;
|
||||||
|
heap_unlink_page(objspace, heap_eden, page);
|
||||||
|
heap_add_page(objspace, heap_tomb, page);
|
||||||
|
}
|
||||||
objspace->profile.total_freed_objects++;
|
objspace->profile.total_freed_objects++;
|
||||||
moved_list = next_moved;
|
moved_list = next_moved;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (use_verifier) {
|
||||||
|
gc_verify_internal_consistency(objspace);
|
||||||
|
}
|
||||||
|
|
||||||
mjit_gc_exit_hook(); // unlock MJIT here, because `rb_gc()` calls `mjit_gc_start_hook()` again.
|
mjit_gc_exit_hook(); // unlock MJIT here, because `rb_gc()` calls `mjit_gc_start_hook()` again.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче