summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-16 09:01:49 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-16 09:01:49 +0000
commit60b7bd2ea3ac0358427a5d344bebdc6225f6c1f2 (patch)
treee80c03b24d15a98115c4cfa92930c17a95336ba7 /gc.c
parentd8eb7f3c0df627af7e2a961bfdcb069a9cde34ac (diff)
* gc.c (rb_objspace_each_objects): should not clear dont_lazy_sweep
flag in nested case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index 7f3304ec59..077f35bd3c 100644
--- a/gc.c
+++ b/gc.c
@@ -1748,13 +1748,20 @@ rb_objspace_each_objects(each_obj_callback *callback, void *data)
{
struct each_obj_args args;
rb_objspace_t *objspace = &rb_objspace;
+ int prev_dont_lazy_sweep = objspace->flags.dont_lazy_sweep;
gc_rest_sweep(objspace);
objspace->flags.dont_lazy_sweep = TRUE;
args.callback = callback;
args.data = data;
- rb_ensure(objspace_each_objects, (VALUE)&args, lazy_sweep_enable, Qnil);
+
+ if (prev_dont_lazy_sweep) {
+ objspace_each_objects((VALUE)&args);
+ }
+ else {
+ rb_ensure(objspace_each_objects, (VALUE)&args, lazy_sweep_enable, Qnil);
+ }
}
struct os_each_struct {