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

ruby-changes:22688

From: naruse <ko1@a...>
Date: Wed, 22 Feb 2012 17:57:31 +0900 (JST)
Subject: [ruby-changes:22688] naruse:r34737 (ruby_1_9_3): merge revision(s) 34719,34720: [Backport #6059]

naruse	2012-02-22 17:57:21 +0900 (Wed, 22 Feb 2012)

  New Revision: 34737

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

  Log:
    merge revision(s) 34719,34720: [Backport #6059]
    
    * gc.c : remove gc_clear_mark_on_sweep_slots() and use
      rest_sweep() instead of it, because some dead objects might be
      marked in next the mark phase by false pointers.
      [ruby-core:42672]

  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/gc.c
    branches/ruby_1_9_3/version.h

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 34736)
+++ ruby_1_9_3/ChangeLog	(revision 34737)
@@ -1,3 +1,10 @@
+Wed Feb 22 08:11:06 2012  Narihiro Nakamura  <authornari@g...>
+
+	* gc.c : remove gc_clear_mark_on_sweep_slots() and use
+	  rest_sweep() instead of it, because some dead objects might be
+	  marked in next the mark phase by false pointers.
+	  [ruby-core:42672]
+
 Sun Feb 19 12:27:24 2012  Nobuyoshi Nakada  <nobu@r...>
 
 	* configure.in: ignore all warnings from an arbitrary
Index: ruby_1_9_3/gc.c
===================================================================
--- ruby_1_9_3/gc.c	(revision 34736)
+++ ruby_1_9_3/gc.c	(revision 34737)
@@ -464,13 +464,12 @@
 #if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
 static void gc_sweep(rb_objspace_t *);
 static void slot_sweep(rb_objspace_t *, struct heaps_slot *);
-static void gc_clear_mark_on_sweep_slots(rb_objspace_t *);
+static void rest_sweep(rb_objspace_t *);
 
 void
 rb_objspace_free(rb_objspace_t *objspace)
 {
-    gc_clear_mark_on_sweep_slots(objspace);
-    gc_sweep(objspace);
+    rest_sweep(objspace);
     if (objspace->profile.record) {
 	free(objspace->profile.record);
 	objspace->profile.record = 0;
@@ -2430,28 +2429,6 @@
 }
 
 static void
-gc_clear_mark_on_sweep_slots(rb_objspace_t *objspace)
-{
-    struct heaps_slot *scan;
-    RVALUE *p, *pend;
-
-    if (objspace->heap.sweep_slots) {
-        while (heaps_increment(objspace));
-        while (objspace->heap.sweep_slots) {
-            scan = objspace->heap.sweep_slots;
-            p = scan->slot; pend = p + scan->limit;
-            while (p < pend) {
-                if (p->as.free.flags & FL_MARK && BUILTIN_TYPE(p) != T_ZOMBIE) {
-                    p->as.basic.flags &= ~FL_MARK;
-                }
-                p++;
-            }
-            objspace->heap.sweep_slots = objspace->heap.sweep_slots->next;
-        }
-    }
-}
-
-static void
 gc_marks(rb_objspace_t *objspace)
 {
     struct gc_list *list;
@@ -2462,8 +2439,6 @@
     objspace->count++;
 
 
-    gc_clear_mark_on_sweep_slots(objspace);
-
     SET_STACK_END;
 
     init_mark_stack(objspace);
@@ -2520,6 +2495,8 @@
 
     GC_PROF_TIMER_START;
 
+    rest_sweep(objspace);
+
     during_gc++;
     gc_marks(objspace);
 
@@ -3025,7 +3002,7 @@
     size_t i;
 
     /* run finalizers */
-    gc_clear_mark_on_sweep_slots(objspace);
+    rest_sweep(objspace);
 
     do {
 	/* XXX: this loop will make no sense */
Index: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 34736)
+++ ruby_1_9_3/version.h	(revision 34737)
@@ -1,10 +1,10 @@
 #define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 135
+#define RUBY_PATCHLEVEL 136
 
-#define RUBY_RELEASE_DATE "2012-02-21"
+#define RUBY_RELEASE_DATE "2012-02-22"
 #define RUBY_RELEASE_YEAR 2012
 #define RUBY_RELEASE_MONTH 2
-#define RUBY_RELEASE_DAY 21
+#define RUBY_RELEASE_DAY 22
 
 #include "ruby/version.h"
 

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

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