* gc.c (after_gc_sweep, slot_sweep): finalizers should be invoked

as soon as possible.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2010-11-04 11:15:36 +00:00
Родитель eb691b7cf1
Коммит 08db452620
2 изменённых файлов: 10 добавлений и 8 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Thu Nov 4 19:13:58 2010 Koichi Sasada <ko1@atdot.net>
* gc.c (after_gc_sweep, slot_sweep): finalizers should be invoked
as soon as possible.
Thu Nov 4 10:30:40 2010 URABE Shyouhei <shyouhei@ruby-lang.org>
* configure.in (--with-valgrind): Now this option is default on.

13
gc.c
Просмотреть файл

@ -1006,7 +1006,6 @@ init_heap(rb_objspace_t *objspace)
finalizer_table = st_init_numtable();
}
static void
set_heaps_increment(rb_objspace_t *objspace)
{
@ -1947,6 +1946,10 @@ slot_sweep(rb_objspace_t *objspace, struct heaps_slot *sweep_slot)
objspace->heap.free_num += free_num;
}
objspace->heap.final_num += final_num;
if (deferred_final_list) {
RUBY_VM_SET_FINALIZER_INTERRUPT(GET_THREAD());
}
}
static int
@ -1995,13 +1998,7 @@ after_gc_sweep(rb_objspace_t *objspace)
}
malloc_increase = 0;
if (deferred_final_list) {
/* clear finalization list */
RUBY_VM_SET_FINALIZER_INTERRUPT(GET_THREAD());
}
else{
free_unused_heaps(objspace);
}
free_unused_heaps(objspace);
/* sweep unlinked method entries */
if (th->vm->unlinked_method_entry_list) {