aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
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