From 3ad60679e37ac36b2d76b12f31036864733bb59f Mon Sep 17 00:00:00 2001 From: nari Date: Sun, 24 Mar 2013 04:20:32 +0000 Subject: [PATCH] * 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 --- ChangeLog | 7 +++++++ gc.c | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f5c2759daa..08f7ac2c64 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sun Mar 24 12:55:47 2013 Narihiro Nakamura + + * 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. + Sun Mar 24 11:03:31 2013 Tanaka Akira * test/ruby/test_require.rb: Remove temporally files in the tests. diff --git a/gc.c b/gc.c index 635e3ecadf..38bdcfd04b 100644 --- a/gc.c +++ b/gc.c @@ -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;