From 1d7966f5b461472bd95184c6cea9f0d1a5bdf1da Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 18 Jun 2013 02:27:37 +0000 Subject: * gc.c (gc_stat): add `generated_normal_object_count_types' for RGENGC_PROFILE >= 2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- gc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gc.c') diff --git a/gc.c b/gc.c index 2f0d25b132..a013b32f58 100644 --- a/gc.c +++ b/gc.c @@ -342,6 +342,7 @@ typedef struct rb_objspace { 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, VALUE v1, VALUE v2, VALUE v3) #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 self) 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); -- cgit v1.2.3