diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-16 09:01:49 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-16 09:01:49 +0000 |
commit | 60b7bd2ea3ac0358427a5d344bebdc6225f6c1f2 (patch) | |
tree | e80c03b24d15a98115c4cfa92930c17a95336ba7 /gc.c | |
parent | d8eb7f3c0df627af7e2a961bfdcb069a9cde34ac (diff) | |
download | ruby-60b7bd2ea3ac0358427a5d344bebdc6225f6c1f2.tar.gz |
* 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.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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 { |