# HG changeset patch # User goetz # Date 1482421885 -3600 # Node ID 7274c72ad9b5b80ca611c29a2e90e7982f59038d # Parent 5fa1aab53b6c1a2ec1b00ec0f1832ef0ceb95d72 8171924: Use SIZE_FORMAT to print size_t values. Reviewed-by: dholmes Contributed-by: arno.zeller@sap.com diff --git a/src/share/vm/code/codeCache.cpp b/src/share/vm/code/codeCache.cpp --- a/src/share/vm/code/codeCache.cpp +++ b/src/share/vm/code/codeCache.cpp @@ -149,16 +149,17 @@ size_t total_size = non_nmethod_size + profiled_size + non_profiled_size; // Prepare error message const char* error = "Invalid code heap sizes"; - err_msg message("NonNMethodCodeHeapSize (%zuK) + ProfiledCodeHeapSize (%zuK) + NonProfiledCodeHeapSize (%zuK) = %zuK", + err_msg message("NonNMethodCodeHeapSize (" SIZE_FORMAT "K) + ProfiledCodeHeapSize (" SIZE_FORMAT "K)" + " + NonProfiledCodeHeapSize (" SIZE_FORMAT "K) = " SIZE_FORMAT "K", non_nmethod_size/K, profiled_size/K, non_profiled_size/K, total_size/K); if (total_size > cache_size) { // Some code heap sizes were explicitly set: total_size must be <= cache_size - message.append(" is greater than ReservedCodeCacheSize (%zuK).", cache_size/K); + message.append(" is greater than ReservedCodeCacheSize (" SIZE_FORMAT "K).", cache_size/K); vm_exit_during_initialization(error, message); } else if (all_set && total_size != cache_size) { // All code heap sizes were explicitly set: total_size must equal cache_size - message.append(" is not equal to ReservedCodeCacheSize (%zuK).", cache_size/K); + message.append(" is not equal to ReservedCodeCacheSize (" SIZE_FORMAT "K).", cache_size/K); vm_exit_during_initialization(error, message); } } @@ -267,7 +268,7 @@ uint min_code_cache_size = CodeCacheMinimumUseSpace DEBUG_ONLY(* 3); if (non_nmethod_size < (min_code_cache_size + code_buffers_size)) { vm_exit_during_initialization(err_msg( - "Not enough space in non-nmethod code heap to run VM: %zuK < %zuK", + "Not enough space in non-nmethod code heap to run VM: " SIZE_FORMAT "K < " SIZE_FORMAT "K", non_nmethod_size/K, (min_code_cache_size + code_buffers_size)/K)); } diff --git a/src/share/vm/gc/g1/g1BiasedArray.hpp b/src/share/vm/gc/g1/g1BiasedArray.hpp --- a/src/share/vm/gc/g1/g1BiasedArray.hpp +++ b/src/share/vm/gc/g1/g1BiasedArray.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,12 +69,12 @@ void initialize(HeapWord* bottom, HeapWord* end, size_t target_elem_size_in_bytes, size_t mapping_granularity_in_bytes) { assert(mapping_granularity_in_bytes > 0, "just checking"); assert(is_power_of_2(mapping_granularity_in_bytes), - "mapping granularity must be power of 2, is %zd", mapping_granularity_in_bytes); + "mapping granularity must be power of 2, is " SIZE_FORMAT, mapping_granularity_in_bytes); assert((uintptr_t)bottom % mapping_granularity_in_bytes == 0, - "bottom mapping area address must be a multiple of mapping granularity %zd, is " PTR_FORMAT, + "bottom mapping area address must be a multiple of mapping granularity " SIZE_FORMAT ", is " PTR_FORMAT, mapping_granularity_in_bytes, p2i(bottom)); assert((uintptr_t)end % mapping_granularity_in_bytes == 0, - "end mapping area address must be a multiple of mapping granularity %zd, is " PTR_FORMAT, + "end mapping area address must be a multiple of mapping granularity " SIZE_FORMAT ", is " PTR_FORMAT, mapping_granularity_in_bytes, p2i(end)); size_t num_target_elems = pointer_delta(end, bottom, mapping_granularity_in_bytes); idx_t bias = (uintptr_t)bottom / mapping_granularity_in_bytes; diff --git a/src/share/vm/prims/jniCheck.cpp b/src/share/vm/prims/jniCheck.cpp --- a/src/share/vm/prims/jniCheck.cpp +++ b/src/share/vm/prims/jniCheck.cpp @@ -238,8 +238,8 @@ size_t live_handles = handles->get_number_of_live_handles(); if (live_handles > planned_capacity) { IN_VM( - tty->print_cr("WARNING: JNI local refs: %zu, exceeds capacity: %zu", - live_handles, planned_capacity); + tty->print_cr("WARNING: JNI local refs: " SIZE_FORMAT ", exceeds capacity: " SIZE_FORMAT, + live_handles, planned_capacity); thr->print_stack(); ) // Complain just the once, reset to current + warn threshold diff --git a/src/share/vm/prims/jvmtiEnter.xsl b/src/share/vm/prims/jvmtiEnter.xsl --- a/src/share/vm/prims/jvmtiEnter.xsl +++ b/src/share/vm/prims/jvmtiEnter.xsl @@ -1246,7 +1246,7 @@ - =0x%zx + =" SIZE_FORMAT_HEX " diff --git a/src/share/vm/services/diagnosticCommand.cpp b/src/share/vm/services/diagnosticCommand.cpp --- a/src/share/vm/services/diagnosticCommand.cpp +++ b/src/share/vm/services/diagnosticCommand.cpp @@ -292,7 +292,7 @@ char *opt = (char *)os::malloc(opt_len, mtInternal); if (opt == NULL) { output()->print_cr("JVMTI agent attach failed: " - "Could not allocate %zu bytes for argument.", + "Could not allocate " SIZE_FORMAT " bytes for argument.", opt_len); return; } diff --git a/src/share/vm/utilities/copy.cpp b/src/share/vm/utilities/copy.cpp --- a/src/share/vm/utilities/copy.cpp +++ b/src/share/vm/utilities/copy.cpp @@ -214,7 +214,7 @@ case 2: do_conjoint_swap(src, dst, byte_count); break; case 4: do_conjoint_swap(src, dst, byte_count); break; case 8: do_conjoint_swap(src, dst, byte_count); break; - default: guarantee(false, "do_conjoint_swap: Invalid elem_size %zd\n", elem_size); + default: guarantee(false, "do_conjoint_swap: Invalid elem_size " SIZE_FORMAT "\n", elem_size); } } };