summaryrefslogtreecommitdiff
path: root/ext/objspace
diff options
context:
space:
mode:
Diffstat (limited to 'ext/objspace')
-rw-r--r--ext/objspace/object_tracing.c5
-rw-r--r--ext/objspace/objspace.c2
-rw-r--r--ext/objspace/objspace_dump.c6
3 files changed, 9 insertions, 4 deletions
diff --git a/ext/objspace/object_tracing.c b/ext/objspace/object_tracing.c
index 45b06aef8c..975518c654 100644
--- a/ext/objspace/object_tracing.c
+++ b/ext/objspace/object_tracing.c
@@ -287,7 +287,10 @@ object_allocations_reporter_i(st_data_t key, st_data_t val, st_data_t ptr)
if (info->class_path) fprintf(out, "C: %s", info->class_path);
else fprintf(out, "C: %p", (void *)info->klass);
fprintf(out, "@%s:%lu", info->path ? info->path : "", info->line);
- if (!NIL_P(info->mid)) fprintf(out, " (%s)", rb_id2name(SYM2ID(info->mid)));
+ if (!NIL_P(info->mid)) {
+ VALUE m = rb_sym2str(info->mid);
+ fprintf(out, " (%s)", RSTRING_PTR(m));
+ }
fprintf(out, ")\n");
return ST_CONTINUE;
diff --git a/ext/objspace/objspace.c b/ext/objspace/objspace.c
index b1f1358c01..88ebfca20e 100644
--- a/ext/objspace/objspace.c
+++ b/ext/objspace/objspace.c
@@ -545,7 +545,7 @@ iow_inspect(VALUE self)
VALUE obj = (VALUE)DATA_PTR(self);
VALUE type = type2sym(BUILTIN_TYPE(obj));
- return rb_sprintf("#<InternalObject:%p %s>", (void *)obj, rb_id2name(SYM2ID(type)));
+ return rb_sprintf("#<InternalObject:%p %"PRIsVALUE">", (void *)obj, rb_sym2str(type));
}
/* Returns the Object#object_id of the internal object. */
diff --git a/ext/objspace/objspace_dump.c b/ext/objspace/objspace_dump.c
index e13cc39a6c..cb8f943d97 100644
--- a/ext/objspace/objspace_dump.c
+++ b/ext/objspace/objspace_dump.c
@@ -244,8 +244,10 @@ dump_object(VALUE obj, struct dump_config *dc)
if ((ainfo = objspace_lookup_allocation_info(obj))) {
dump_append(dc, ", \"file\":\"%s\", \"line\":%lu", ainfo->path, ainfo->line);
- if (RTEST(ainfo->mid))
- dump_append(dc, ", \"method\":\"%s\"", rb_id2name(SYM2ID(ainfo->mid)));
+ if (RTEST(ainfo->mid)) {
+ VALUE m = rb_sym2str(ainfo->mid);
+ dump_append(dc, ", \"method\":\"%s\"", RSTRING_PTR(m));
+ }
dump_append(dc, ", \"generation\":%"PRIuSIZE, ainfo->generation);
}