summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-18 02:27:37 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-18 02:27:37 +0000
commit1d7966f5b461472bd95184c6cea9f0d1a5bdf1da (patch)
tree9b79acb00dc4b538fc4593cee19c32cec3bf01d4 /gc.c
parent17cd5ac4af3b8aaec568e41e5531af65cd1adf45 (diff)
* 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
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c9
1 files changed, 8 insertions, 1 deletions
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);