[前][次][番号順一覧][スレッド一覧]

ruby-changes:33291

From: ko1 <ko1@a...>
Date: Thu, 20 Mar 2014 17:05:45 +0900 (JST)
Subject: [ruby-changes:33291] ko1:r45370 (trunk): * gc.c (objspace_malloc_increase): should not invoke

ko1	2014-03-20 17:05:35 +0900 (Thu, 20 Mar 2014)

  New Revision: 45370

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45370

  Log:
    * 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].

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45369)
+++ ChangeLog	(revision 45370)
@@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Mar 20 16:53:07 2014  Koichi Sasada  <ko1@a...>
+
+	* 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@a...>
 
 	* struct.c (rb_struct_alloc): use RARRAY_CONST_PTR() instead of
Index: gc.c
===================================================================
--- gc.c	(revision 45369)
+++ gc.c	(revision 45370)
@@ -6038,12 +6038,12 @@ objspace_malloc_increase(rb_objspace_t * https://github.com/ruby/ruby/blob/trunk/gc.c#L6038
     }
 
     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;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]