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

ruby-changes:29461

From: ko1 <ko1@a...>
Date: Fri, 21 Jun 2013 09:24:25 +0900 (JST)
Subject: [ruby-changes:29461] ko1:r41513 (trunk): * gc.c (slot_sweep_body): add counters at a time.

ko1	2013-06-21 09:24:14 +0900 (Fri, 21 Jun 2013)

  New Revision: 41513

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

  Log:
    * gc.c (slot_sweep_body): add counters at a time.
    * gc.c (gc_profile_dump_on): fix line break position.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41512)
+++ ChangeLog	(revision 41513)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Jun 21 09:22:16 2013  Koichi Sasada  <ko1@a...>
+
+	* gc.c (slot_sweep_body): add counters at a time.
+
+	* gc.c (gc_profile_dump_on): fix line break position.
+
 Fri Jun 21 08:14:00 2013  Masaya Tarui  <tarui@r...>
 
 	* gc.c: refactoring bitmaps. introduce bits_t type and some Consts.
Index: gc.c
===================================================================
--- gc.c	(revision 41512)
+++ gc.c	(revision 41513)
@@ -2209,15 +2209,7 @@ slot_sweep_body(rb_objspace_t *objspace, https://github.com/ruby/ruby/blob/trunk/gc.c#L2209
     RVALUE *final = deferred_final_list;
     int deferred;
     bits_t *bits, bitset;
-#if GC_PROFILE_MORE_DETAIL
-    gc_profile_record *record=NULL;
-#endif
 
-#if GC_PROFILE_MORE_DETAIL
-    if (objspace->profile.run) {
-	record = gc_prof_record(objspace);
-    }
-#endif
     rgengc_report(3, objspace, "slot_sweep_body: start.\n");
 
     p = sweep_slot->header->start; pend = p + sweep_slot->header->limit;
@@ -2235,9 +2227,6 @@ slot_sweep_body(rb_objspace_t *objspace, https://github.com/ruby/ruby/blob/trunk/gc.c#L2227
 	    do {
 		if ((bitset & 1) && BUILTIN_TYPE(p) != T_ZOMBIE) {
 		    if (p->as.basic.flags) {
-#if GC_PROFILE_MORE_DETAIL
-			if(record) record->removing_objects++;
-#endif
 			rgengc_report(3, objspace, "slot_sweep_body: free %p (%s)\n", p, obj_type_name((VALUE)p));
 #if USE_RGENGC && RGENGC_CHECK_MODE
 			if (objspace->rgengc.during_minor_gc && RVALUE_PROMOTED((VALUE)p)) rb_bug("slot_sweep_body: %p (%s) is promoted.\n", p, obj_type_name((VALUE)p));
@@ -2263,10 +2252,6 @@ slot_sweep_body(rb_objspace_t *objspace, https://github.com/ruby/ruby/blob/trunk/gc.c#L2252
 			}
 		    }
 		    else {
-#if GC_PROFILE_MORE_DETAIL
-			if(record)
-			    record->empty_objects++;
-#endif
 			empty_num++;
 		    }
 		}
@@ -2275,12 +2260,22 @@ slot_sweep_body(rb_objspace_t *objspace, https://github.com/ruby/ruby/blob/trunk/gc.c#L2260
 	    } while (bitset);
 	}
     }
+
 #if USE_RGENGC
     gc_setup_mark_bits(sweep_slot);
 #else
     gc_clear_slot_bits(sweep_slot);
 #endif
 
+#if GC_PROFILE_MORE_DETAIL
+    if (objspace->profile.run) {
+	gc_profile_record *record = gc_prof_record(objspace);
+	record->removing_objects += final_num + freed_num;
+	record->empty_objects += empty_num;
+    }
+#endif
+
+
     if (final_num + freed_num + empty_num == sweep_slot->header->limit &&
         objspace->heap.free_num > objspace->heap.do_heap_free) {
         RVALUE *pp;
@@ -5348,10 +5343,9 @@ gc_profile_dump_on(VALUE out, VALUE (*ap https://github.com/ruby/ruby/blob/trunk/gc.c#L5343
 #endif
 				   " %9"PRIuSIZE" %17.12f %17.12f %17.12f %10"PRIuSIZE" %10"PRIuSIZE" %10"PRIuSIZE" %10"PRIuSIZE
 #if RGENGC_PROFILE
-				   "%10"PRIuSIZE" %10"PRIuSIZE" %10"PRIuSIZE"\n"
+				   "%10"PRIuSIZE" %10"PRIuSIZE" %10"PRIuSIZE
 #endif
-				   ,
-
+				   "\n",
 				   i+1,
 				   (record->flags & GPR_FLAG_MINOR) ? '-' : '+',
 				   (record->flags & GPR_FLAG_HAVE_FINALIZE) ? 'F' : '.',

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

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