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

ruby-changes:36069

From: nobu <ko1@a...>
Date: Mon, 27 Oct 2014 13:40:28 +0900 (JST)
Subject: [ruby-changes:36069] nobu:r48150 (trunk): gc.c: fix no lazy sweep mode

nobu	2014-10-27 13:40:13 +0900 (Mon, 27 Oct 2014)

  New Revision: 48150

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

  Log:
    gc.c: fix no lazy sweep mode
    
    * gc.c (gc_sweep_rest): sweep rest pages regardless of whether
      lazy sweep is enabled or not.  based on the patch by Masahiro
      Ide at [ruby-dev:48706].  [Bug #10431]

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 48149)
+++ ChangeLog	(revision 48150)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Oct 27 13:40:11 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* gc.c (gc_sweep_rest): sweep rest pages regardless of whether
+	  lazy sweep is enabled or not.  based on the patch by Masahiro
+	  Ide at [ruby-dev:48706].  [Bug #10431]
+
 Mon Oct 27 11:18:32 2014  Eric Wong  <e@8...>
 
 	* test/ruby/test_process.rb (test_deadlock_by_signal_at_forking):
Index: gc.c
===================================================================
--- gc.c	(revision 48149)
+++ gc.c	(revision 48150)
@@ -700,7 +700,8 @@ VALUE *ruby_initial_gc_stress_ptr = &rub https://github.com/ruby/ruby/blob/trunk/gc.c#L700
 #else
 #define is_incremental_marking(objspace) 0
 #endif
-#define is_lazy_sweeping(heap)           (GC_ENABLE_LAZY_SWEEP       && (heap)->sweep_pages != 0)
+#define has_sweeping_pages(heap)         ((heap)->sweep_pages != 0)
+#define is_lazy_sweeping(heap)           (GC_ENABLE_LAZY_SWEEP && has_sweeping_pages(heap))
 #if GC_ENABLE_INCREMENTAL_MARK
 #define will_be_incremental_marking(objspace) ((objspace)->rgengc.need_major_gc != GPR_FLAG_NONE)
 #else
@@ -3315,10 +3316,8 @@ gc_sweep_rest(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L3316
 {
     rb_heap_t *heap = heap_eden; /* lazy sweep only for eden */
 
-    if (is_lazy_sweeping(heap)) {
-	while (is_lazy_sweeping(heap)) {
-	    gc_sweep_step(objspace, heap);
-	}
+    while (has_sweeping_pages(heap)) {
+	gc_sweep_step(objspace, heap);
     }
 }
 

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

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