diff --git a/ChangeLog b/ChangeLog index 8e81106af9..bc73b9b020 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Jul 20 14:21:38 2010 Narihiro Nakamura + + * gc.c: don't call after_gc_sweep() after when garbage_collect() + was called, because rb_sweep_method_entry() free live unlinked + method entries. [ruby-core:31169] + Tue Jul 20 12:42:06 2010 URABE Shyouhei * ext/socket/raddrinfo.c (rb_getaddrinfo): according to my diff --git a/gc.c b/gc.c index 0c139400cf..db3dce55bf 100644 --- a/gc.c +++ b/gc.c @@ -2055,16 +2055,17 @@ gc_lazy_sweep(rb_objspace_t *objspace) GC_PROF_TIMER_START; GC_PROF_SWEEP_TIMER_START; - res = lazy_sweep(objspace); - if (res) { - GC_PROF_SWEEP_TIMER_STOP; - GC_PROF_SET_MALLOC_INFO; - GC_PROF_TIMER_STOP(Qfalse); - return res; + if (objspace->heap.sweep_slots) { + res = lazy_sweep(objspace); + if (res) { + GC_PROF_SWEEP_TIMER_STOP; + GC_PROF_SET_MALLOC_INFO; + GC_PROF_TIMER_STOP(Qfalse); + return res; + } + after_gc_sweep(objspace); } - after_gc_sweep(objspace); - gc_marks(objspace); before_gc_sweep(objspace);