From bde38738580e074c25204dc9f08d584aee85c7f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Sat, 14 Jun 2003 15:05:13 +0000 Subject: Backport 2.3 FreeBSD recursion_limit settings. Fixes #553736. --- Modules/_sre.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Modules/_sre.c b/Modules/_sre.c index 308b726..a83cdcf 100644 --- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -76,9 +76,23 @@ static char copyright[] = /* FIXME: maybe the limit should be 40000 / sizeof(void*) ? */ #define USE_RECURSION_LIMIT 7500 #else +#if defined(__GNUC__) && defined(WITH_THREAD) && defined(__FreeBSD__) +/* the pthreads library on FreeBSD has a fixed 1MB stack size for the + * initial (or "primary") thread, which is insufficient for the default + * recursion limit. gcc 3.x at the default optimisation + * level (-O3) uses stack space more aggressively than gcc 2.95. + */ +#if (__GNUC__ > 2) +#define USE_RECURSION_LIMIT 6500 +#else +#define USE_RECURSION_LIMIT 7500 +#endif + +#else #define USE_RECURSION_LIMIT 10000 #endif #endif +#endif /* enables fast searching */ #define USE_FAST_SEARCH -- cgit v0.12