summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-09-16 00:05:25 (GMT)
committerKoichi Sasada <ko1@atdot.net>2020-09-18 05:17:49 (GMT)
commitb189dc6926fffe1cdb04422c5116ad3ca1425cb7 (patch)
tree0c21b6e44569dabc9bab36caafc48ea5b4eed2d5
parentdd5db6f5fed359efc85cff25d326b5fc3de66614 (diff)
rb_obj_info() shows more info for T_SYMBOL
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3548
-rw-r--r--gc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 38d1463..4b0fd06 100644
--- a/gc.c
+++ b/gc.c
@@ -11861,6 +11861,17 @@ rb_raw_obj_info(char *buff, const int buff_size, VALUE obj)
APPENDF((BUFF_ARGS, "%.*s", str_len_no_raise(obj), RSTRING_PTR(obj)));
break;
}
+ case T_SYMBOL: {
+ VALUE fstr = RSYMBOL(obj)->fstr;
+ ID id = RSYMBOL(obj)->id;
+ if (RB_TYPE_P(fstr, T_STRING)) {
+ APPENDF((BUFF_ARGS, ":%s id:%d", RSTRING_PTR(fstr), (unsigned int)id));
+ }
+ else {
+ APPENDF((BUFF_ARGS, "(%p) id:%d", (void *)fstr, (unsigned int)id));
+ }
+ break;
+ }
case T_MOVED: {
APPENDF((BUFF_ARGS, "-> %p", (void*)rb_gc_location(obj)));
break;