diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | gc.c | 14 |
2 files changed, 6 insertions, 12 deletions
@@ -1,7 +1,3 @@ -Tue Jul 16 14:59:09 2013 Koichi Sasada <ko1@atdot.net> - - * gc.c (after_gc_sweep): refactoring code. - Tue Jul 16 13:32:06 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> * encoding.c (enc_set_index): since r41967, old terminator is dealt @@ -2384,20 +2384,18 @@ after_gc_sweep(rb_objspace_t *objspace) static int lazy_sweep(rb_objspace_t *objspace) { - struct heaps_slot *slot; + struct heaps_slot *next; int result = FALSE; gc_prof_sweep_timer_start(objspace); heaps_increment(objspace); - slot = objspace->heap.sweep_slots; + while (is_lazy_sweeping(objspace)) { + next = objspace->heap.sweep_slots->next; + slot_sweep(objspace, objspace->heap.sweep_slots); + objspace->heap.sweep_slots = next; - while (slot) { - slot_sweep(objspace, slot); - - if ((objspace->heap.sweep_slots = slot = slot->next) == NULL) { - after_gc_sweep(objspace); - } + if (!next) after_gc_sweep(objspace); if (has_free_object) { result = TRUE; |