]> git.eshelyaron.com Git - emacs.git/commitdiff
(main): Don't extend stack limit too far.
authorRichard M. Stallman <rms@gnu.org>
Mon, 3 Feb 1997 02:51:09 +0000 (02:51 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 3 Feb 1997 02:51:09 +0000 (02:51 +0000)
src/emacs.c

index 7349a21698d9bb7aafb36a3fbe98d4b255933455..d98c30463f75715d6268be03e397aae1ddd8c825 100644 (file)
@@ -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