diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-09 02:01:54 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-09 02:01:54 +0000 |
commit | b9d00698c8280fbb1f95dcbec63d12357a078248 (patch) | |
tree | e9bcdc820d90c2da044f43a28b85884185ea7e4f /ext | |
parent | 9f81048b45a3c8cc984568ad8d2e94f9a209ebfc (diff) | |
download | ruby-b9d00698c8280fbb1f95dcbec63d12357a078248.tar.gz |
Revert "ext/objspace/objspace_dump.c: print addresses consistently"
This reverts commit r64970.
Visual C++ 12.0 doesn't have PRIxPTR.
Anyway we have our own vfprintf implementation BSD_vfprintf().
If you want to have portable vfprintf, replace it with BSD_vfprintf like
vsnprintf or just use BSD_vfprintf.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/objspace/objspace_dump.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/objspace/objspace_dump.c b/ext/objspace/objspace_dump.c index 092fa6f68e..afc41892d1 100644 --- a/ext/objspace/objspace_dump.c +++ b/ext/objspace/objspace_dump.c @@ -172,9 +172,9 @@ reachable_object_i(VALUE ref, void *data) return; if (dc->cur_obj_references == 0) - dump_append(dc, ", \"references\":[\"0x%"PRIxPTR"\"", ref); + dump_append(dc, ", \"references\":[\"%p\"", (void *)ref); else - dump_append(dc, ", \"0x%"PRIxPTR"\"", ref); + dump_append(dc, ", \"%p\"", (void *)ref); dc->cur_obj_references++; } @@ -235,10 +235,10 @@ dump_object(VALUE obj, struct dump_config *dc) if (dc->cur_obj == dc->string) return; - dump_append(dc, "{\"address\":\"0x%"PRIxPTR"\", \"type\":\"%s\"", obj, obj_type(obj)); + dump_append(dc, "{\"address\":\"%p\", \"type\":\"%s\"", (void *)obj, obj_type(obj)); if (dc->cur_obj_klass) - dump_append(dc, ", \"class\":\"0x%"PRIxPTR"\"", dc->cur_obj_klass); + dump_append(dc, ", \"class\":\"%p\"", (void *)dc->cur_obj_klass); if (rb_obj_frozen_p(obj)) dump_append(dc, ", \"frozen\":true"); @@ -274,7 +274,7 @@ dump_object(VALUE obj, struct dump_config *dc) case T_HASH: dump_append(dc, ", \"size\":%"PRIuSIZE, (size_t)RHASH_SIZE(obj)); if (FL_TEST(obj, HASH_PROC_DEFAULT)) - dump_append(dc, ", \"default\":\"0x%"PRIxPTR"\"", RHASH_IFNONE(obj)); + dump_append(dc, ", \"default\":\"%p\"", (void *)RHASH_IFNONE(obj)); break; case T_ARRAY: @@ -363,9 +363,9 @@ root_obj_i(const char *category, VALUE obj, void *data) if (dc->root_category != NULL && category != dc->root_category) dump_append(dc, "]}\n"); if (dc->root_category == NULL || category != dc->root_category) - dump_append(dc, "{\"type\":\"ROOT\", \"root\":\"%s\", \"references\":[\"0x%"PRIxPTR"\"", category, obj); + dump_append(dc, "{\"type\":\"ROOT\", \"root\":\"%s\", \"references\":[\"%p\"", category, (void *)obj); else - dump_append(dc, ", \"0x%"PRIxPTR"\"", obj); + dump_append(dc, ", \"%p\"", (void *)obj); dc->root_category = category; dc->roots++; |