aboutsummaryrefslogtreecommitdiffstats
path: root/debug.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-27 08:01:14 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-27 08:01:14 +0000
commitf365cd2c9aa4018044cc4005d1d2309faff6b58c (patch)
tree361b8e57a82ede0fdd6b580293443bb07e335ca7 /debug.c
parent1ccdddb7e4171bb773e924e5a4b02c9401ba835e (diff)
downloadruby-f365cd2c9aa4018044cc4005d1d2309faff6b58c.tar.gz
* gc.c: simplify threshold of GC caused by malloc_increase.
Now, malloc_limit is increased/decreased by mysterious logic. This fix simplify malloc_limit increase/decrease logic such as: if (malloc_increase > malloc_limit) /* so many malloc */ malloc_limit += malloc_limit * (GC_MALLOC_LIMIT_FACTOR-1); else malloc_limit -= malloc_limit * (GC_MALLOC_LIMIT_FACTOR-1)/4; Default value of GC_MALLOC_LIMIT_FACTOR is 1.8. malloc_limit is bounded by GC_MALLOC_LIMIT_MAX (256MB by default). This logic runs at before_sweeep(). So there are no effect from caused by lazy sweep. And we can remove malloc_increase2. * gc.c (HEAP_MIN_SLOTS, FREE_MIN, HEAP_GROWTH_FACTOR): rename to GC_HEAP_MIN_SLOTS, GC_FREE_MIN, GC_HEAP_GROWTH_FACTOR respectively. Check them by `#ifndef' so you can specify these values outside gc.c. * gc.c (ruby_gc_params_t): add initial_malloc_limit_factor and initial_malloc_limit_max. * gc.c (vm_malloc_prepare, vm_xrealloc): use vm_malloc_increase to add and check malloc_increase. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'debug.c')
0 files changed, 0 insertions, 0 deletions