diff options
author | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-24 04:20:32 +0000 |
---|---|---|
committer | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-24 04:20:32 +0000 |
commit | 3ad60679e37ac36b2d76b12f31036864733bb59f (patch) | |
tree | 39aaef3fae5059edc33c30e60d68f01c92ff817e /gc.c | |
parent | 052c0e67d99552aeb2091d1ae7133465a5aa7291 (diff) | |
download | ruby-3ad60679e37ac36b2d76b12f31036864733bb59f.tar.gz |
* gc.c: We have no chance to expand the heap when lazy sweeping is
restricted. So collecting is often invoked if there is not
enough free space in the heap. Try to expand heap when this is
the case.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -2043,8 +2043,14 @@ gc_prepare_free_objects(rb_objspace_t *objspace) { int res; - if (objspace->flags.dont_lazy_sweep) - return garbage_collect(objspace); + if (objspace->flags.dont_lazy_sweep) { + if (heaps_increment(objspace)) { + return; + } + else { + return garbage_collect(objspace); + } + } if (!ready_to_gc(objspace)) return TRUE; |