7179383: MaxDirectMemorySize argument parsing is broken for values >2G

Change hotspot flag to be unsigned

Reviewed-by: dholmes, sla, fparain, brutisso
This commit is contained in:
Chris Dennis 2012-07-03 01:41:29 -04:00 committed by David Holmes
parent 135f315eaa
commit d1080de4ee
3 changed files with 19 additions and 4 deletions

View file

@ -345,9 +345,13 @@ JVM_ENTRY(jobject, JVM_InitProperties(JNIEnv *env, jobject properties))
// Do this after setting user properties to prevent people
// from setting the value with a -D option, as requested.
{
char as_chars[256];
jio_snprintf(as_chars, sizeof(as_chars), INTX_FORMAT, MaxDirectMemorySize);
PUTPROP(props, "sun.nio.MaxDirectMemorySize", as_chars);
if (FLAG_IS_DEFAULT(MaxDirectMemorySize)) {
PUTPROP(props, "sun.nio.MaxDirectMemorySize", "-1");
} else {
char as_chars[256];
jio_snprintf(as_chars, sizeof(as_chars), UINTX_FORMAT, MaxDirectMemorySize);
PUTPROP(props, "sun.nio.MaxDirectMemorySize", as_chars);
}
}
// JVM monitoring and management support