hotspot/src/share/vm/utilities/globalDefinitions.hpp
changeset 12625 f121df45d98f
parent 11480 1bf714e8adb4
child 12629 cd6a72ba4d23
--- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp	Fri May 11 14:54:35 2012 -0700
+++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp	Mon May 14 17:32:17 2012 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, 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
@@ -188,17 +188,17 @@
   }
 }
 
-inline size_t byte_size_in_proper_unit(size_t s) {
+template <class T>
+inline T byte_size_in_proper_unit(T s) {
   if (s >= 10*M) {
-    return s/M;
+    return (T)(s/M);
   } else if (s >= 10*K) {
-    return s/K;
+    return (T)(s/K);
   } else {
     return s;
   }
 }
 
-
 //----------------------------------------------------------------------------------------------------
 // VM type definitions