8153835: Fix range of flag MaxDirectMemorySize which is parsed at jlong

Changed MaxDirectMemorySize type to uint64_t and set max to max_jlong

Reviewed-by: goetz, simonis
This commit is contained in:
Gerard Ziemski 2016-04-28 10:41:53 -05:00
parent 7d20b786fd
commit 41a3e98a61
2 changed files with 3 additions and 3 deletions

View File

@ -389,7 +389,7 @@ JVM_ENTRY(jobject, JVM_InitProperties(JNIEnv *env, jobject properties))
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);
}
}

View File

@ -3847,9 +3847,9 @@ public:
\
/* 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 */ \
\