From b2d4591455d21e86b271c1f728f69daafa6bae18 Mon Sep 17 00:00:00 2001 From: Bengt Rutisson Date: Tue, 15 May 2012 22:26:37 +0200 Subject: [PATCH] 7169056: Add gigabyte unit to proper_unit_for_byte_size() and byte_size_in_proper_unit() Reviewed-by: jwilhelm, johnc, dholmes --- hotspot/src/share/vm/utilities/globalDefinitions.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp index 55904058bf8..82a9333b789 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -179,6 +179,11 @@ const jlong NANOSECS_PER_SEC = CONST64(1000000000); const jint NANOSECS_PER_MILLISEC = 1000000; inline const char* proper_unit_for_byte_size(size_t s) { +#ifdef _LP64 + if (s >= 10*G) { + return "G"; + } +#endif if (s >= 10*M) { return "M"; } else if (s >= 10*K) { @@ -190,6 +195,11 @@ inline const char* proper_unit_for_byte_size(size_t s) { template inline T byte_size_in_proper_unit(T s) { +#ifdef _LP64 + if (s >= 10*G) { + return (T)(s/G); + } +#endif if (s >= 10*M) { return (T)(s/M); } else if (s >= 10*K) {