1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
ko1 2013-11-09 16:35:54 +00:00
parent b3abb163f4
commit 9782d219f3
2 changed files with 8 additions and 2 deletions

View file

@ -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.

4
gc.c
View file

@ -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);
}
}
}