diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-09 16:35:54 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-09 16:35:54 +0000 |
commit | 9782d219f34aded1d0b80f7bdff809132550561e (patch) | |
tree | 63d87b058d7e68a7a1e29c0811e11b6072e51b1c | |
parent | b3abb163f4e0e5cc52aa5b4dfacff4273c0510c9 (diff) | |
download | ruby-9782d219f34aded1d0b80f7bdff809132550561e.tar.gz |
* gc.c (vm_malloc_increase): sweep immediately on GC due to malloc().
To reduce memory usage, sweep as soon as possible.
This behavior is same as Ruby 2.0.0 and before.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | gc.c | 4 |
2 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,9 @@ +Sun Nov 10 01:34:14 2013 Koichi Sasada <ko1@atdot.net> + + * gc.c (vm_malloc_increase): sweep immediately on GC due to malloc(). + To reduce memory usage, sweep as soon as possible. + This behavior is same as Ruby 2.0.0 and before. + Sun Nov 10 00:39:26 2013 Koichi Sasada <ko1@atdot.net> * benchmark/gc/gcbench.rb: output version description and GC::OPTS. @@ -5449,7 +5449,7 @@ vm_malloc_increase(rb_objspace_t *objspace, size_t new_size, size_t old_size, in if (do_gc) { if (ruby_gc_stress && !ruby_disable_gc_stress) { - garbage_collect_with_gvl(objspace, 0, 0, GPR_FLAG_MALLOC); + garbage_collect_with_gvl(objspace, FALSE, TRUE, GPR_FLAG_MALLOC); } else { retry: @@ -5458,7 +5458,7 @@ vm_malloc_increase(rb_objspace_t *objspace, size_t new_size, size_t old_size, in gc_rest_sweep(objspace); /* rest_sweep can reduce malloc_increase */ goto retry; } - garbage_collect_with_gvl(objspace, 0, 0, GPR_FLAG_MALLOC); + garbage_collect_with_gvl(objspace, FALSE, TRUE, GPR_FLAG_MALLOC); } } } |