[Python-checkins] python/dist/src/Modules _sre.c,2.77.6.1,2.77.6.2

loewis@users.sourceforge.net loewis@users.sourceforge.net
Sat, 14 Jun 2003 08:03:09 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv11554/Modules

Modified Files:
      Tag: release22-maint
	_sre.c 
Log Message:
Backport FreeBSD recursion limit. Fixes #553736.


Index: _sre.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v
retrieving revision 2.77.6.1
retrieving revision 2.77.6.2
diff -C2 -d -r2.77.6.1 -r2.77.6.2
*** _sre.c	31 Jul 2002 11:19:49 -0000	2.77.6.1
--- _sre.c	14 Jun 2003 15:03:06 -0000	2.77.6.2
***************
*** 89,93 ****
--- 89,107 ----
  #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