aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1997-02-03 02:51:09 +0000
committerRichard M. Stallman1997-02-03 02:51:09 +0000
commit509a8fcde89b144b6638693f1bbeb854e7aa492c (patch)
treec7061e554e93ff5553abd8fdfc447affea7eb17f /src
parent917e56592f7553f3f8d7967e18e035460d2c5cf2 (diff)
downloademacs-509a8fcde89b144b6638693f1bbeb854e7aa492c.tar.gz
emacs-509a8fcde89b144b6638693f1bbeb854e7aa492c.zip
(main): Don't extend stack limit too far.
Diffstat (limited to 'src')
-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)
553 /* Extend the stack space available. */ 553 /* Extend the stack space available. */
554 if (!getrlimit (RLIMIT_STACK, &rlim)) 554 if (!getrlimit (RLIMIT_STACK, &rlim))
555 { 555 {
556 rlim.rlim_cur = rlim.rlim_max; 556 long newlim;
557 /* Approximate the amount regex.c needs, plus some more. */
558 newlim = 800000 * sizeof (char *);
559 if (newlim > rlim.rlim_max)
560 newlim = rlim.rlim_max;
561 if (rlim.rlim_cur < newlim)
562 rlim.rlim_cur = newlim;
563
557 setrlimit (RLIMIT_STACK, &rlim); 564 setrlimit (RLIMIT_STACK, &rlim);
558 } 565 }
559#endif 566#endif