Mercurial > hg > truffle
diff src/share/vm/runtime/arguments.cpp @ 6199:3f1ab0c19c30
7179383: MaxDirectMemorySize argument parsing is broken for values >2G
Summary: change hotspot flag to be unsigned
Reviewed-by: dholmes, sla, fparain, brutisso
Contributed-by: Chris Dennis <cdennis@terracottatech.com>
author | dholmes |
---|---|
date | Tue, 03 Jul 2012 01:41:29 -0400 |
parents | 24b9c7f4cae6 |
children | 90d5a592ea8f |
line wrap: on
line diff
--- a/src/share/vm/runtime/arguments.cpp Mon Jul 02 13:11:28 2012 -0400 +++ b/src/share/vm/runtime/arguments.cpp Tue Jul 03 01:41:29 2012 -0400 @@ -2709,6 +2709,17 @@ return JNI_EINVAL; } FLAG_SET_CMDLINE(uintx, ConcGCThreads, conc_threads); + } else if (match_option(option, "-XX:MaxDirectMemorySize=", &tail)) { + julong max_direct_memory_size = 0; + ArgsRange errcode = parse_memory_size(tail, &max_direct_memory_size, 0); + if (errcode != arg_in_range) { + jio_fprintf(defaultStream::error_stream(), + "Invalid maximum direct memory size: %s\n", + option->optionString); + describe_range_error(errcode); + return JNI_EINVAL; + } + FLAG_SET_CMDLINE(uintx, MaxDirectMemorySize, max_direct_memory_size); } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx // Skip -XX:Flags= since that case has already been handled if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) {