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
--- 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 */ \
\