changeset 16968:7c030111c6bb

(main): Don't extend stack limit too far.
author Richard M. Stallman <rms@gnu.org>
date Mon, 03 Feb 1997 02:51:09 +0000
parents 4ca0a5e25605
children 436fd36233d1
files src/emacs.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/emacs.c	Sun Feb 02 15:41:27 1997 +0000
+++ b/src/emacs.c	Mon Feb 03 02:51:09 1997 +0000
@@ -553,7 +553,14 @@
   /* 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