static const char *type_name() implemented

The function body was missing.
This commit is contained in:
卜部昌平 2024-07-16 04:32:19 +02:00
Родитель 963059a8d2
Коммит a887b41875
1 изменённых файлов: 34 добавлений и 1 удалений

Просмотреть файл

@ -7558,7 +7558,40 @@ rb_gc_impl_during_gc_p(void *objspace_ptr)
#if RGENGC_PROFILE >= 2 #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 static void
gc_count_add_each_types(VALUE hash, const char *name, const size_t *types) gc_count_add_each_types(VALUE hash, const char *name, const size_t *types)