mirror of
https://github.com/corda/corda.git
synced 2025-01-31 16:35:43 +00:00
Merge pull request #20 from csoren/master
A simple fix to accept upper case size suffixes for the -Xm parameters
This commit is contained in:
commit
e4dfb79618
@ -3345,11 +3345,11 @@ parseSize(const char* s)
|
|||||||
RUNTIME_ARRAY(char, buffer, length + 1);
|
RUNTIME_ARRAY(char, buffer, length + 1);
|
||||||
if (length == 0) {
|
if (length == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
} else if (s[length - 1] == 'k') {
|
} else if (s[length - 1] == 'k' or s[length - 1] == 'K') {
|
||||||
memcpy(RUNTIME_ARRAY_BODY(buffer), s, length - 1);
|
memcpy(RUNTIME_ARRAY_BODY(buffer), s, length - 1);
|
||||||
RUNTIME_ARRAY_BODY(buffer)[length - 1] = 0;
|
RUNTIME_ARRAY_BODY(buffer)[length - 1] = 0;
|
||||||
return atoi(RUNTIME_ARRAY_BODY(buffer)) * 1024;
|
return atoi(RUNTIME_ARRAY_BODY(buffer)) * 1024;
|
||||||
} else if (s[length - 1] == 'm') {
|
} else if (s[length - 1] == 'm' or s[length - 1] == 'M') {
|
||||||
memcpy(RUNTIME_ARRAY_BODY(buffer), s, length - 1);
|
memcpy(RUNTIME_ARRAY_BODY(buffer), s, length - 1);
|
||||||
RUNTIME_ARRAY_BODY(buffer)[length - 1] = 0;
|
RUNTIME_ARRAY_BODY(buffer)[length - 1] = 0;
|
||||||
return atoi(RUNTIME_ARRAY_BODY(buffer)) * 1024 * 1024;
|
return atoi(RUNTIME_ARRAY_BODY(buffer)) * 1024 * 1024;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user