summaryrefslogtreecommitdiff
path: root/ext/objspace
diff options
context:
space:
mode:
authorrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-13 12:33:13 (GMT)
committerrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-13 12:33:13 (GMT)
commit2f551849c4e05c96569739d8f057a4ea41e33300 (patch)
treeb8f72758501d5fec20755a8de36c6a478c0902ef /ext/objspace
parenteaba77154f179446b838437cd0cb6f4be04523df (diff)
Use PRIuSIZE format specifier for size_t values
Use PRIuSIZE instead of PRIdSIZE. This fixes the exception message shown on too large xmalloc2. This commit also fixes other incorrect use of PRIdSIZE in other functions; though most of them are debug print. * gc.c (heap_extend_pages, get_envparam_size, ruby_malloc_size_overflow, gc_profile_dump_on): Use PRIuSIZE instead of PRIdSIZE as the passed value is size_t, not ssize_t. * iseq.c (get_line_info, rb_iseq_disasm_insn): Ditto. * sprintf.c (rb_str_format): Ditto. * thread_win32.c (native_thread_create): Ditto. * vm.c (get_param): Ditto. * ext/objspace/objspace_dump.c (dump_append_string_content, dump_object): Ditto. * ext/socket/raddrinfo.c (host_str, port_str): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/objspace')
-rw-r--r--ext/objspace/objspace_dump.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/objspace/objspace_dump.c b/ext/objspace/objspace_dump.c
index 47aaaf2..0dd3a9e 100644
--- a/ext/objspace/objspace_dump.c
+++ b/ext/objspace/objspace_dump.c
@@ -182,7 +182,7 @@ dump_append_string_content(struct dump_config *dc, VALUE obj)
{
dump_append(dc, ", \"bytesize\":%ld", RSTRING_LEN(obj));
if (!STR_EMBED_P(obj) && !STR_SHARED_P(obj) && (long)rb_str_capacity(obj) != RSTRING_LEN(obj))
- dump_append(dc, ", \"capacity\":%"PRIdSIZE, rb_str_capacity(obj));
+ dump_append(dc, ", \"capacity\":%"PRIuSIZE, rb_str_capacity(obj));
if (is_ascii_string(obj)) {
dump_append(dc, ", \"value\":");
@@ -248,7 +248,7 @@ dump_object(VALUE obj, struct dump_config *dc, int part)
break;
case T_HASH:
- dump_append(dc, ", \"size\":%"PRIdSIZE, (size_t)RHASH_SIZE(obj));
+ dump_append(dc, ", \"size\":%"PRIuSIZE, (size_t)RHASH_SIZE(obj));
if (FL_TEST(obj, HASH_PROC_DEFAULT))
dump_append(dc, ", \"default\":\"%p\"", (void *)RHASH_IFNONE(obj));
break;