mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
17cd5ac4af
commit
1d7966f5b4
2 changed files with 13 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
Tue Jun 18 11:26:05 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* gc.c (gc_stat): add `generated_normal_object_count_types' for
|
||||
RGENGC_PROFILE >= 2.
|
||||
|
||||
Tue Jun 18 11:02:18 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* gc.c (gc_mark_maybe): check to skip T_NONE.
|
||||
|
|
9
gc.c
9
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);
|
||||
|
|
Loading…
Reference in a new issue