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

ruby-changes:31544

From: ko1 <ko1@a...>
Date: Sun, 10 Nov 2013 01:36:00 +0900 (JST)
Subject: [ruby-changes:31544] ko1:r43623 (trunk): * gc.c (vm_malloc_increase): sweep immediately on GC due to malloc().

ko1	2013-11-10 01:35:54 +0900 (Sun, 10 Nov 2013)

  New Revision: 43623

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

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

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43622)
+++ ChangeLog	(revision 43623)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Nov 10 01:34:14 2013  Koichi Sasada  <ko1@a...>
+
+	* 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@a...>
 
 	* benchmark/gc/gcbench.rb: output version description and GC::OPTS.
Index: gc.c
===================================================================
--- gc.c	(revision 43622)
+++ gc.c	(revision 43623)
@@ -5449,7 +5449,7 @@ vm_malloc_increase(rb_objspace_t *objspa https://github.com/ruby/ruby/blob/trunk/gc.c#L5449
 
     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 *objspa https://github.com/ruby/ruby/blob/trunk/gc.c#L5458
 		    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);
 	    }
 	}
     }

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

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