summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-02-03 02:51:09 +0000
committerRichard M. Stallman <rms@gnu.org>1997-02-03 02:51:09 +0000
commitcf0bf791d490ff0fdbc44ccf932ab8fa8b5e2d2b (patch)
tree3d840f98269412ad59da799305644d93627e8e5c
parentb4e694df04ce0d931179f0f4862ae4c852c95e38 (diff)
downloademacs-cf0bf791d490ff0fdbc44ccf932ab8fa8b5e2d2b.tar.gz
(main): Don't extend stack limit too far.
-rw-r--r--src/emacs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 7349a21698d..d98c30463f7 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -553,7 +553,14 @@ main (argc, argv, envp)
/* Extend the stack space available. */
if (!getrlimit (RLIMIT_STACK, &rlim))
{
- rlim.rlim_cur = rlim.rlim_max;
+ long newlim;
+ /* Approximate the amount regex.c needs, plus some more. */
+ newlim = 800000 * sizeof (char *);
+ if (newlim > rlim.rlim_max)
+ newlim = rlim.rlim_max;
+ if (rlim.rlim_cur < newlim)
+ rlim.rlim_cur = newlim;
+
setrlimit (RLIMIT_STACK, &rlim);
}
#endif