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

ruby-changes:32152

From: ko1 <ko1@a...>
Date: Mon, 16 Dec 2013 14:18:30 +0900 (JST)
Subject: [ruby-changes:32152] ko1:r44231 (trunk): * gc.c: use gc_verify_internal_consistency() instead of

ko1	2013-12-16 14:18:21 +0900 (Mon, 16 Dec 2013)

  New Revision: 44231

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

  Log:
    * gc.c: use gc_verify_internal_consistency() instead of
      gc_check_before_marks_i() for check consistency
      on RGENGC_CHECK_MODE >= 2.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 44230)
+++ ChangeLog	(revision 44231)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Dec 16 14:14:22 2013  Koichi Sasada  <ko1@a...>
+
+	* gc.c: use gc_verify_internal_consistency() instead of
+	  gc_check_before_marks_i() for check consistency 
+	  on RGENGC_CHECK_MODE >= 2.
+
 Mon Dec 16 14:01:48 2013  NARUSE, Yui  <naruse@r...>
 
 	* process.c (make_clock_result): add :second as a unit for
Index: gc.c
===================================================================
--- gc.c	(revision 44230)
+++ gc.c	(revision 44231)
@@ -4206,7 +4206,7 @@ gc_verify_internal_consistency(VALUE sel https://github.com/ruby/ruby/blob/trunk/gc.c#L4206
     return Qnil;
 }
 
-#if RGENGC_CHECK_MODE >= 2
+#if RGENGC_CHECK_MODE >= 3
 
 #define MAKE_ROOTSIG(obj) (((VALUE)(obj) << 1) | 0x01)
 #define IS_ROOTSIG(obj)   ((VALUE)(obj) & 0x01)
@@ -4394,35 +4394,6 @@ allrefs_dump(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L4394
 }
 #endif
 
-static int
-gc_check_before_marks_i(st_data_t k, st_data_t v, void *ptr)
-{
-    VALUE obj = k;
-    struct reflist *refs = (struct reflist *)v;
-    rb_objspace_t *objspace = (rb_objspace_t *)ptr;
-
-    /* check WB sanity */
-    if (!RVALUE_OLD_P(obj)) {
-	int i;
-	for (i=0; i<refs->pos; i++) {
-	    VALUE parent = refs->list[i];
-	    if (!IS_ROOTSIG(parent) && RVALUE_OLD_P(parent)) {
-		/* parent is old */
-		if (!MARKED_IN_BITMAP(GET_HEAP_PAGE(parent)->rememberset_bits, parent) &&
-		    !MARKED_IN_BITMAP(GET_HEAP_PAGE(obj)->rememberset_bits, obj)) {
-		    fprintf(stderr, "gc_marks_check_i: WB miss %p (%s) -> %p (%s) ",
-			    (void *)parent, obj_type_name(parent),
-			    (void *)obj, obj_type_name(obj));
-		    reflist_dump(refs);
-		    fprintf(stderr, "\n");
-		    objspace->rgengc.error_count++;
-		}
-	    }
-	}
-    }
-    return ST_CONTINUE;
-}
-
 #if RGENGC_CHECK_MODE >= 3
 static int
 gc_check_after_marks_i(st_data_t k, st_data_t v, void *ptr)
@@ -4496,7 +4467,7 @@ gc_marks(rb_objspace_t *objspace, int fu https://github.com/ruby/ruby/blob/trunk/gc.c#L4467
 #if USE_RGENGC
 
 #if RGENGC_CHECK_MODE >= 2
-	gc_marks_check(objspace, gc_check_before_marks_i, "before_marks");
+	gc_verify_internal_consistency(Qnil);
 #endif
 	if (full_mark == TRUE) { /* major/full GC */
 	    objspace->rgengc.remembered_shady_object_count = 0;

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

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