Skip to content

Commit

Permalink
static const char *type_name() implemented
Browse files Browse the repository at this point in the history
The function body was missing.
  • Loading branch information
shyouhei committed Jul 16, 2024
1 parent 78fba0a commit f5f077e
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion gc/default.c
Original file line number Diff line number Diff line change
Expand Up @@ -7558,7 +7558,40 @@ rb_gc_impl_during_gc_p(void *objspace_ptr)

#if RGENGC_PROFILE >= 2

static const char *type_name(int type, VALUE obj);
static const char*
type_name(int type, VALUE obj)
{
switch ((enum ruby_value_type)type) {
case RUBY_T_NONE: return "T_NONE";
case RUBY_T_OBJECT: return "T_OBJECT";
case RUBY_T_CLASS: return "T_CLASS";
case RUBY_T_MODULE: return "T_MODULE";
case RUBY_T_FLOAT: return "T_FLOAT";
case RUBY_T_STRING: return "T_STRING";
case RUBY_T_REGEXP: return "T_REGEXP";
case RUBY_T_ARRAY: return "T_ARRAY";
case RUBY_T_HASH: return "T_HASH";
case RUBY_T_STRUCT: return "T_STRUCT";
case RUBY_T_BIGNUM: return "T_BIGNUM";
case RUBY_T_FILE: return "T_FILE";
case RUBY_T_DATA: return "T_DATA";
case RUBY_T_MATCH: return "T_MATCH";
case RUBY_T_COMPLEX: return "T_COMPLEX";
case RUBY_T_RATIONAL: return "T_RATIONAL";
case RUBY_T_NIL: return "T_NIL";
case RUBY_T_TRUE: return "T_TRUE";
case RUBY_T_FALSE: return "T_FALSE";
case RUBY_T_SYMBOL: return "T_SYMBOL";
case RUBY_T_FIXNUM: return "T_FIXNUM";
case RUBY_T_UNDEF: return "T_UNDEF";
case RUBY_T_IMEMO: return "T_IMEMO";
case RUBY_T_NODE: return "T_NODE";
case RUBY_T_ICLASS: return "T_ICLASS";
case RUBY_T_ZOMBIE: return "T_ZOMBIE";
case RUBY_T_MOVED: return "T_MOVED";
default: return "unknown";
}
}

static void
gc_count_add_each_types(VALUE hash, const char *name, const size_t *types)
Expand Down

0 comments on commit f5f077e

Please sign in to comment.