# HG changeset patch # User Richard M. Stallman # Date 854938269 0 # Node ID 7c030111c6bb01bebd697d8429fd7e54fbbd6eec # Parent 4ca0a5e256050324e2550f18342b60b4552dc937 (main): Don't extend stack limit too far. diff -r 4ca0a5e25605 -r 7c030111c6bb src/emacs.c --- 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