diff options
author | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-12 05:05:18 +0000 |
---|---|---|
committer | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-12 05:05:18 +0000 |
commit | e199582e24a5b8233380502e550019bd3055189e (patch) | |
tree | db930620aa6f15e5df04f5f0aeb26d09b8ebaf4b /gc.c | |
parent | ba6e227350a3751bf163bfae675ea0a3a6d88aa6 (diff) |
* backport r32894 from trunk.
* gc.c (gc_lazy_sweep): if sweep target slots are not found, we
try heap_increment() because it might be able to expand the
heap. [Bug #5127] [ruby-dev:44285]
* gc.c (gc_clear_mark_on_sweep_slots): if a sweeping was
interrupted, we expand the heap if at all possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -2172,6 +2172,12 @@ gc_lazy_sweep(rb_objspace_t *objspace) } after_gc_sweep(objspace); } + else { + if (heaps_increment(objspace)) { + during_gc = 0; + return TRUE; + } + } gc_marks(objspace); @@ -2417,6 +2423,7 @@ gc_clear_mark_on_sweep_slots(rb_objspace_t *objspace) RVALUE *p, *pend; if (objspace->heap.sweep_slots) { + while (heaps_increment(objspace)); while (objspace->heap.sweep_slots) { scan = objspace->heap.sweep_slots; p = scan->slot; pend = p + scan->limit; |