>>>> "Vin" == Vin Shelton
<acs(a)alumni.princeton.edu> writes:
Vin> Your patch is increasing the size of the stack from 20 to 40.
Vin> That seems to be enough in this case, but does anyone have any idea what
Vin> the real limit should be? The FSF emacs code seems to be entirely
Vin> different.
I'm not sure if it is related, but I've been running the following patch for a
while, which adjusts the max failure values to those currently being used by
GNU Emacs.
It has certainly reduced the problems that I've had with regex stack
overflows in really large compilation buffers.
Malcolm
Index: src/regex.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/regex.c,v
retrieving revision 1.56
diff -u -r1.56 regex.c
--- src/regex.c 2005/03/09 04:59:31 1.56
+++ src/regex.c 2006/03/20 12:29:33
@@ -1314,7 +1314,7 @@
when matching. If this number is exceeded, we allocate more
space, so it is not a hard limit. */
#ifndef INIT_FAILURE_ALLOC
-#define INIT_FAILURE_ALLOC 5
+#define INIT_FAILURE_ALLOC 20
#endif
/* Roughly the maximum number of failure points on the stack. Would be
@@ -1324,9 +1324,9 @@
#if defined (MATCH_MAY_ALLOCATE)
/* 4400 was enough to cause a crash on Alpha OSF/1,
whose default stack limit is 2mb. */
-int re_max_failures = 20000;
+int re_max_failures = 40000;
#else
-int re_max_failures = 2000;
+int re_max_failures = 4000;
#endif
union fail_stack_elt
--
Malcolm Purvis <malcolmp(a)xemacs.org>