diff options
author | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-20 06:14:40 +0000 |
---|---|---|
committer | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-20 06:14:40 +0000 |
commit | 81cc3b26550324e94cc50d24d113174cd4339062 (patch) | |
tree | 47becb79f477a377819fef810c5a70e7e3f5b282 /gc.c | |
parent | a52dd6cc5c011fbebc3e00261eaade73ec981bf8 (diff) | |
download | ruby-81cc3b26550324e94cc50d24d113174cd4339062.tar.gz |
* 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]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -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); |