aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-20 08:05:35 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-20 08:05:35 +0000
commit3e20c50d509708bc0c0dedb02ec8dbfbfe1ac301 (patch)
treed8e013d8f07bd8f0cd403f74910fe3b1a887aaf2
parentc813697d97832ffe4d660ab9bf0e5c3519448071 (diff)
downloadruby-3e20c50d509708bc0c0dedb02ec8dbfbfe1ac301.tar.gz
* gc.c (objspace_malloc_increase): should not invoke
garbage_collect_with_gvl() here on non-ruby threads. Should just ignore the malloc_increase. This issue is pointed by Eric Wong [ruby-core:61519]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog9
-rw-r--r--gc.c4
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e81d557d37..320767eca8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Thu Mar 20 16:53:07 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (objspace_malloc_increase): should not invoke
+ garbage_collect_with_gvl() here on non-ruby threads.
+
+ Should just ignore the malloc_increase.
+
+ This issue is pointed by Eric Wong [ruby-core:61519].
+
Thu Mar 20 13:05:16 2014 Koichi Sasada <ko1@atdot.net>
* struct.c (rb_struct_alloc): use RARRAY_CONST_PTR() instead of
diff --git a/gc.c b/gc.c
index 95e13c692c..081d26adf7 100644
--- a/gc.c
+++ b/gc.c
@@ -6038,12 +6038,12 @@ objspace_malloc_increase(rb_objspace_t *objspace, void *mem, size_t new_size, si
}
if (type == MEMOP_TYPE_MALLOC) {
- if (ruby_gc_stress && !ruby_disable_gc_stress) {
+ if (ruby_gc_stress && !ruby_disable_gc_stress && ruby_native_thread_p()) {
garbage_collect_with_gvl(objspace, FALSE, TRUE, GPR_FLAG_MALLOC);
}
else {
retry:
- if (malloc_increase > malloc_limit) {
+ if (malloc_increase > malloc_limit && ruby_native_thread_p()) {
if (ruby_thread_has_gvl_p() && is_lazy_sweeping(heap_eden)) {
gc_rest_sweep(objspace); /* rest_sweep can reduce malloc_increase */
goto retry;