summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-18 08:11:52 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-18 08:11:52 +0000
commit542e63b95346b5709871a4e9cc3c98a35146c0ed (patch)
treead0eb47e4139ebfd4d5878a989a9faba96e9feca /gc.c
parent301ae01bb59217db5a8b3707c8ebaaef51102961 (diff)
rb_raw_obj_info() support T_MODULE and T_ICLASS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/gc.c b/gc.c
index 528dabaca9..0629489b66 100644
--- a/gc.c
+++ b/gc.c
@@ -9715,13 +9715,23 @@ rb_raw_obj_info(char *buff, const int buff_size, VALUE obj)
(int)RHASH_SIZE(obj));
break;
}
- case T_CLASS: {
- VALUE class_path = rb_class_path_cached(obj);
- if (!NIL_P(class_path)) {
- snprintf(buff, buff_size, "%s %s", buff, RSTRING_PTR(class_path));
- }
- break;
- }
+ case T_CLASS:
+ case T_MODULE:
+ {
+ VALUE class_path = rb_class_path_cached(obj);
+ if (!NIL_P(class_path)) {
+ snprintf(buff, buff_size, "%s %s", buff, RSTRING_PTR(class_path));
+ }
+ break;
+ }
+ case T_ICLASS:
+ {
+ VALUE class_path = rb_class_path_cached(RBASIC_CLASS(obj));
+ if (!NIL_P(class_path)) {
+ snprintf(buff, buff_size, "%s src:%s", buff, RSTRING_PTR(class_path));
+ }
+ break;
+ }
case T_OBJECT:
{
uint32_t len = ROBJECT_NUMIV(obj);