Skip to content

Commit

Permalink
removed the 2 GB upper limit for the --hard-memory-limit option
Browse files Browse the repository at this point in the history
  • Loading branch information
troy4eg committed Jan 15, 2024
1 parent f413abe commit d452c1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ int convert_bytes_num_to_string(long long bytes, char *res, int res_size) {
}

int parse_time_limit(const char *s) {
int x;
int x = 0;
char c = 0;
if (sscanf(s, "%d%c", &x, &c) < 1) {
kprintf ("Parsing time limit for option fail: %s\n", s);
Expand Down
6 changes: 5 additions & 1 deletion server/php-engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1840,7 +1840,11 @@ int main_args_handler(int i, const char *long_option) {
}
case 'm': {
max_memory = parse_memory_limit_default(optarg, 'm');
assert((1 << 20) <= max_memory && max_memory <= (2047LL << 20));
const long long min_size = 1 << 20;
if (max_memory <= min_size) {
kprintf("--%s option: cannot be less than 1 megabyte\n", long_option);
return -1;
}
return 0;
}
case 'f': {
Expand Down

0 comments on commit d452c1a

Please sign in to comment.