[Python-checkins] python/dist/src/Include ceval.h,2.49,2.50

arigo at users.sourceforge.net arigo at users.sourceforge.net
Tue Oct 28 07:05:49 EST 2003


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

Modified Files:
	ceval.h 
Log Message:
Deleting cyclic object comparison.
SF patch 825639
http://mail.python.org/pipermail/python-dev/2003-October/039445.html



Index: ceval.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/ceval.h,v
retrieving revision 2.49
retrieving revision 2.50
diff -C2 -d -r2.49 -r2.50
*** ceval.h	20 Feb 2003 17:59:17 -0000	2.49
--- ceval.h	28 Oct 2003 12:05:46 -0000	2.50
***************
*** 44,49 ****
--- 44,63 ----
  PyAPI_FUNC(int) Py_MakePendingCalls(void);
  
+ /* Protection against deeply nested recursive calls */
  PyAPI_FUNC(void) Py_SetRecursionLimit(int);
  PyAPI_FUNC(int) Py_GetRecursionLimit(void);
+ 
+ #define Py_EnterRecursiveCall(where)                                    \
+ 	    (_Py_MakeRecCheck(PyThreadState_GET()->recursion_depth) &&  \
+ 	     _Py_CheckRecursiveCall(where))
+ #define Py_LeaveRecursiveCall()				\
+ 	    (--PyThreadState_GET()->recursion_depth)
+ PyAPI_FUNC(int) _Py_CheckRecursiveCall(char *where);
+ PyAPI_DATA(int) _Py_CheckRecursionLimit;
+ #ifdef USE_STACKCHECK
+ #  define _Py_MakeRecCheck(x)  (++(x) > --_Py_CheckRecursionLimit)
+ #else
+ #  define _Py_MakeRecCheck(x)  (++(x) > _Py_CheckRecursionLimit)
+ #endif
  
  PyAPI_FUNC(char *) PyEval_GetFuncName(PyObject *);





More information about the Python-checkins mailing list