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

ruby-changes:29321

From: ko1 <ko1@a...>
Date: Tue, 18 Jun 2013 11:27:47 +0900 (JST)
Subject: [ruby-changes:29321] ko1:r41373 (trunk): * gc.c (gc_stat): add `generated_normal_object_count_types' for

ko1	2013-06-18 11:27:37 +0900 (Tue, 18 Jun 2013)

  New Revision: 41373

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

  Log:
    * gc.c (gc_stat): add `generated_normal_object_count_types' for
      RGENGC_PROFILE >= 2.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41372)
+++ ChangeLog	(revision 41373)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Jun 18 11:26:05 2013  Koichi Sasada  <ko1@a...>
+
+	* gc.c (gc_stat): add `generated_normal_object_count_types' for
+	  RGENGC_PROFILE >= 2.
+
 Tue Jun 18 11:02:18 2013  Koichi Sasada  <ko1@a...>
 
 	* gc.c (gc_mark_maybe): check to skip T_NONE.
Index: gc.c
===================================================================
--- gc.c	(revision 41372)
+++ gc.c	(revision 41373)
@@ -342,6 +342,7 @@ typedef struct rb_objspace { https://github.com/ruby/ruby/blob/trunk/gc.c#L342
 	size_t remembered_normal_object_count;
 	size_t remembered_shady_object_count;
 #if RGENGC_PROFILE >= 2
+	size_t generated_normal_object_count_types[RUBY_T_MASK];
 	size_t generated_shady_object_count_types[RUBY_T_MASK];
 	size_t shade_operation_count_types[RUBY_T_MASK];
 	size_t promote_operation_count_types[RUBY_T_MASK];
@@ -934,7 +935,12 @@ newobj_of(VALUE klass, VALUE flags, VALU https://github.com/ruby/ruby/blob/trunk/gc.c#L935
 #endif
 
 #if RGENGC_PROFILE
-    if (flags & FL_WB_PROTECTED) objspace->profile.generated_normal_object_count++;
+    if (flags & FL_WB_PROTECTED) {
+	objspace->profile.generated_normal_object_count++;
+#if RGENGC_PROFILE >= 2
+	objspace->profile.generated_normal_object_count_types[BUILTIN_TYPE(obj)]++;
+#endif
+    }
     else {
 	objspace->profile.generated_shady_object_count++;
 #if RGENGC_PROFILE >= 2
@@ -4120,6 +4126,7 @@ gc_stat(int argc, VALUE *argv, VALUE sel https://github.com/ruby/ruby/blob/trunk/gc.c#L4126
     rb_hash_aset(hash, sym_remembered_shady_object_count, SIZET2NUM(objspace->profile.remembered_shady_object_count));
 #if RGENGC_PROFILE >= 2
     {
+	gc_count_add_each_types(hash, "generated_normal_object_count_types", objspace->profile.generated_normal_object_count_types);
 	gc_count_add_each_types(hash, "generated_shady_object_count_types", objspace->profile.generated_shady_object_count_types);
 	gc_count_add_each_types(hash, "shade_operation_count_types", objspace->profile.shade_operation_count_types);
 	gc_count_add_each_types(hash, "promote_operation_count_types", objspace->profile.promote_operation_count_types);

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

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