changeset 3732:cdfa5139bd58

7169056: Add gigabyte unit to proper_unit_for_byte_size() and byte_size_in_proper_unit() Reviewed-by: jwilhelm, johnc, dholmes
author brutisso
date Tue, 15 May 2012 22:26:37 +0200
parents 1096fc5a52eb
children 9d679effd28c
files src/share/vm/utilities/globalDefinitions.hpp
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/utilities/globalDefinitions.hpp	Tue May 15 09:49:18 2012 -0700
+++ b/src/share/vm/utilities/globalDefinitions.hpp	Tue May 15 22:26:37 2012 +0200
@@ -179,6 +179,11 @@
 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 @@
 
 template <class T>
 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) {