comparison src/share/vm/prims/jvm.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 f7c4174b33ba
children e74da3c2b827
comparison
equal deleted inserted replaced
6198:24b9c7f4cae6 6199:3f1ab0c19c30
343 // Convert the -XX:MaxDirectMemorySize= command line flag 343 // Convert the -XX:MaxDirectMemorySize= command line flag
344 // to the sun.nio.MaxDirectMemorySize property. 344 // to the sun.nio.MaxDirectMemorySize property.
345 // Do this after setting user properties to prevent people 345 // Do this after setting user properties to prevent people
346 // from setting the value with a -D option, as requested. 346 // from setting the value with a -D option, as requested.
347 { 347 {
348 char as_chars[256]; 348 if (FLAG_IS_DEFAULT(MaxDirectMemorySize)) {
349 jio_snprintf(as_chars, sizeof(as_chars), INTX_FORMAT, MaxDirectMemorySize); 349 PUTPROP(props, "sun.nio.MaxDirectMemorySize", "-1");
350 PUTPROP(props, "sun.nio.MaxDirectMemorySize", as_chars); 350 } else {
351 char as_chars[256];
352 jio_snprintf(as_chars, sizeof(as_chars), UINTX_FORMAT, MaxDirectMemorySize);
353 PUTPROP(props, "sun.nio.MaxDirectMemorySize", as_chars);
354 }
351 } 355 }
352 356
353 // JVM monitoring and management support 357 // JVM monitoring and management support
354 // Add the sun.management.compiler property for the compiler's name 358 // Add the sun.management.compiler property for the compiler's name
355 { 359 {