8153835: Fix range of flag MaxDirectMemorySize which is parsed at jlong
authorgziemski
Thu, 28 Apr 2016 10:41:53 -0500
changeset 38118 16e2f219e1b6
parent 38111 02d1ce4fb721
child 38119 73a5fe26aa22
8153835: Fix range of flag MaxDirectMemorySize which is parsed at jlong Summary: Changed MaxDirectMemorySize type to uint64_t and set max to max_jlong Reviewed-by: goetz, simonis
hotspot/src/share/vm/prims/jvm.cpp
hotspot/src/share/vm/runtime/globals.hpp
--- a/hotspot/src/share/vm/prims/jvm.cpp	Thu Apr 28 09:10:10 2016 +0000
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Thu Apr 28 10:41:53 2016 -0500
@@ -389,7 +389,7 @@
       PUTPROP(props, "sun.nio.MaxDirectMemorySize", "-1");
     } else {
       char as_chars[256];
-      jio_snprintf(as_chars, sizeof(as_chars), SIZE_FORMAT, MaxDirectMemorySize);
+      jio_snprintf(as_chars, sizeof(as_chars), JULONG_FORMAT, MaxDirectMemorySize);
       PUTPROP(props, "sun.nio.MaxDirectMemorySize", as_chars);
     }
   }
--- a/hotspot/src/share/vm/runtime/globals.hpp	Thu Apr 28 09:10:10 2016 +0000
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Thu Apr 28 10:41:53 2016 -0500
@@ -3847,9 +3847,9 @@
                                                                             \
   /* Properties for Java libraries  */                                      \
                                                                             \
-  product(size_t, MaxDirectMemorySize, 0,                                   \
+  product(uint64_t, MaxDirectMemorySize, 0,                                 \
           "Maximum total size of NIO direct-buffer allocations")            \
-          range(0, (size_t)SIZE_MAX)                                        \
+          range(0, max_jlong)                                               \
                                                                             \
   /* Flags used for temporary code during development  */                   \
                                                                             \