summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authornari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-09 04:26:15 +0000
committernari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-09 04:26:15 +0000
commite26cead1e99e10ab3e672e0894ebdc8c277c833c (patch)
tree1a9c478b7fb14271fa0abfc7d18ae074bce5f94d /gc.c
parent75a84097adf38474b20e6f4f3b2fa2ef35e4bd60 (diff)
* 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/trunk@32894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index d893dd7e55..3fc465b482 100644
--- a/gc.c
+++ b/gc.c
@@ -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;