From: Glenn Morris Date: Tue, 9 Oct 2018 20:12:55 +0000 (-0700) Subject: Merge from origin/emacs-26 X-Git-Tag: emacs-27.0.90~4318 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b4e664f3a4222c0f95322fabd184a69f5dc953ed;p=emacs.git Merge from origin/emacs-26 86d2169 Avoid ridiculously high stack limit requests on macOS ac3622c Improve documentation of 'read-hide-char' # Conflicts: # src/emacs.c --- b4e664f3a4222c0f95322fabd184a69f5dc953ed diff --cc src/emacs.c index b7a82793523,f80047e89e7..07df191035c --- a/src/emacs.c +++ b/src/emacs.c @@@ -888,11 -883,12 +889,13 @@@ main (int argc, char **argv lim = newlim; } } - /* If the stack is big enough, let regex.c more of it before - falling back to heap allocation. */ + /* If the stack is big enough, let regex-emacs.c use more of it + before falling back to heap allocation. */ + if (lim < extra) - lim = extra; /* avoid wrap-around in unsigned subtraction */ - emacs_re_safe_alloca = - max (min (lim - extra, SIZE_MAX) * (min_ratio / ratio), MAX_ALLOCA); ++ lim = extra; /* avoid wrap-around in unsigned subtraction */ + ptrdiff_t max_failures + = min (lim - extra, min (PTRDIFF_MAX, SIZE_MAX)) / ratio; + emacs_re_safe_alloca = max (max_failures * min_ratio, MAX_ALLOCA); } #endif /* HAVE_SETRLIMIT and RLIMIT_STACK and not CYGWIN */