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

ruby-changes:29351

From: ko1 <ko1@a...>
Date: Wed, 19 Jun 2013 07:14:45 +0900 (JST)
Subject: [ruby-changes:29351] ko1:r41403 (trunk): * gc.c (rgengc_remember): fix output level.

ko1	2013-06-19 07:12:39 +0900 (Wed, 19 Jun 2013)

  New Revision: 41403

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

  Log:
    * gc.c (rgengc_remember): fix output level.
    * gc.c (rgengc_rememberset_mark): fix to output clear count.
      (shady_object_count + clear_count = count of remembered objects)

  Modified files:
    trunk/ChangeLog
    trunk/gc.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41402)
+++ ChangeLog	(revision 41403)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jun 19 07:09:26 2013  Koichi Sasada  <ko1@a...>
+
+	* gc.c (rgengc_remember): fix output level.
+
+	* gc.c (rgengc_rememberset_mark): fix to output clear count.
+	  (shady_object_count + clear_count = count of remembered objects)
+
 Wed Jun 19 07:06:21 2013  Koichi Sasada  <ko1@a...>
 
 	* gc.c (rgengc_remember): check T_NONE and T_ZOMBIE
Index: gc.c
===================================================================
--- gc.c	(revision 41402)
+++ gc.c	(revision 41403)
@@ -3628,7 +3628,7 @@ rgengc_remembersetbits_set(rb_objspace_t https://github.com/ruby/ruby/blob/trunk/gc.c#L3628
 static void
 rgengc_remember(rb_objspace_t *objspace, VALUE obj)
 {
-    rgengc_report(0, objspace, "rgengc_remember: %p (%s, %s) %s\n", (void *)obj, obj_type_name(obj),
+    rgengc_report(2, objspace, "rgengc_remember: %p (%s, %s) %s\n", (void *)obj, obj_type_name(obj),
 		  RVALUE_SHADY(obj) ? "shady" : "non-shady",
 		  rgengc_remembersetbits_get(objspace, obj) ? "was already remembered" : "is remembered now");
 
@@ -3677,7 +3677,7 @@ static size_t https://github.com/ruby/ruby/blob/trunk/gc.c#L3677
 rgengc_rememberset_mark(rb_objspace_t *objspace)
 {
     size_t i, j;
-    size_t shady_object_count = 0;
+    size_t shady_object_count = 0, clear_count = 0;
     RVALUE *p, *offset;
     uintptr_t *bits, bitset;
 
@@ -3700,6 +3700,7 @@ rgengc_rememberset_mark(rb_objspace_t *o https://github.com/ruby/ruby/blob/trunk/gc.c#L3700
 			if (!RVALUE_SHADY(p)) {
 			    rgengc_report(2, objspace, "rgengc_rememberset_mark: clear %p (%s)\n", p, obj_type_name((VALUE)p));
 			    CLEAR_IN_BITMAP(bits, p);
+			    clear_count++;
 			}
 			else {
 			    shady_object_count++;
@@ -3712,7 +3713,7 @@ rgengc_rememberset_mark(rb_objspace_t *o https://github.com/ruby/ruby/blob/trunk/gc.c#L3713
 	}
     }
 
-    rgengc_report(2, objspace, "rgengc_rememberset_mark: mark_cnt: %"PRIdSIZE", shady_object_count: %"PRIdSIZE"\n", shady_object_count);
+    rgengc_report(2, objspace, "rgengc_rememberset_mark: clear_count: %"PRIdSIZE", shady_object_count: %"PRIdSIZE"\n", clear_count, shady_object_count);
 
     return shady_object_count;
 }

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

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