diff options
| -rw-r--r-- | src/emacs.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/emacs.c b/src/emacs.c index bdcebbe1637..b8ba86f7356 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -851,11 +851,14 @@ main (int argc, char **argv) | |||
| 851 | /* Round the new limit to a page boundary; this is needed | 851 | /* Round the new limit to a page boundary; this is needed |
| 852 | for Darwin kernel 15.4.0 (see Bug#23622) and perhaps | 852 | for Darwin kernel 15.4.0 (see Bug#23622) and perhaps |
| 853 | other systems. Do not shrink the stack and do not exceed | 853 | other systems. Do not shrink the stack and do not exceed |
| 854 | rlim_max. Don't worry about values like RLIM_INFINITY | 854 | rlim_max. Don't worry about exact values of |
| 855 | since in practice they are so large that the code does | 855 | RLIM_INFINITY etc. since in practice when they are |
| 856 | the right thing anyway. */ | 856 | nonnegative they are so large that the code does the |
| 857 | right thing anyway. */ | ||
| 857 | long pagesize = getpagesize (); | 858 | long pagesize = getpagesize (); |
| 858 | newlim = min (newlim + pagesize - 1, rlim.rlim_max); | 859 | newlim += pagesize - 1; |
| 860 | if (0 <= rlim.rlim_max && rlim.rlim_max < newlim) | ||
| 861 | newlim = rlim.rlim_max; | ||
| 859 | newlim -= newlim % pagesize; | 862 | newlim -= newlim % pagesize; |
| 860 | 863 | ||
| 861 | if (pagesize <= newlim - lim) | 864 | if (pagesize <= newlim - lim) |