Mercurial > hg > truffle
comparison 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 |
comparison
equal
deleted
inserted
replaced
6198:24b9c7f4cae6 | 6199:3f1ab0c19c30 |
---|---|
2707 jio_fprintf(defaultStream::error_stream(), | 2707 jio_fprintf(defaultStream::error_stream(), |
2708 "Invalid concurrent threads: %s\n", option->optionString); | 2708 "Invalid concurrent threads: %s\n", option->optionString); |
2709 return JNI_EINVAL; | 2709 return JNI_EINVAL; |
2710 } | 2710 } |
2711 FLAG_SET_CMDLINE(uintx, ConcGCThreads, conc_threads); | 2711 FLAG_SET_CMDLINE(uintx, ConcGCThreads, conc_threads); |
2712 } else if (match_option(option, "-XX:MaxDirectMemorySize=", &tail)) { | |
2713 julong max_direct_memory_size = 0; | |
2714 ArgsRange errcode = parse_memory_size(tail, &max_direct_memory_size, 0); | |
2715 if (errcode != arg_in_range) { | |
2716 jio_fprintf(defaultStream::error_stream(), | |
2717 "Invalid maximum direct memory size: %s\n", | |
2718 option->optionString); | |
2719 describe_range_error(errcode); | |
2720 return JNI_EINVAL; | |
2721 } | |
2722 FLAG_SET_CMDLINE(uintx, MaxDirectMemorySize, max_direct_memory_size); | |
2712 } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx | 2723 } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx |
2713 // Skip -XX:Flags= since that case has already been handled | 2724 // Skip -XX:Flags= since that case has already been handled |
2714 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) { | 2725 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) { |
2715 if (!process_argument(tail, args->ignoreUnrecognized, origin)) { | 2726 if (!process_argument(tail, args->ignoreUnrecognized, origin)) { |
2716 return JNI_EINVAL; | 2727 return JNI_EINVAL; |