Skip to content

Commit 3d64a3e

Browse files
committed
empty recursion macros - we're not checking recursion limits as Python does
1 parent b375441 commit 3d64a3e

File tree

1 file changed

+4
-13
lines changed
  • graalpython/com.oracle.graal.python.cext/include

1 file changed

+4
-13
lines changed

graalpython/com.oracle.graal.python.cext/include/ceval.h

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,8 @@ PyAPI_FUNC(int) Py_MakePendingCalls(void);
9494
PyAPI_FUNC(void) Py_SetRecursionLimit(int);
9595
PyAPI_FUNC(int) Py_GetRecursionLimit(void);
9696

97-
#define Py_EnterRecursiveCall(where) \
98-
(_Py_MakeRecCheck(PyThreadState_GET()->recursion_depth) && \
99-
_Py_CheckRecursiveCall(where))
100-
#define Py_LeaveRecursiveCall() \
101-
do{ if(_Py_MakeEndRecCheck(PyThreadState_GET()->recursion_depth)) \
102-
PyThreadState_GET()->overflowed = 0; \
103-
} while(0)
97+
#define Py_EnterRecursiveCall(where) 0
98+
#define Py_LeaveRecursiveCall()
10499
PyAPI_FUNC(int) _Py_CheckRecursiveCall(const char *where);
105100

106101
/* Due to the macros in which it's used, _Py_CheckRecursionLimit is in
@@ -130,13 +125,9 @@ PyAPI_DATA(int) _Py_CheckRecursionLimit;
130125
#define _Py_MakeEndRecCheck(x) \
131126
(--(x) < _Py_RecursionLimitLowerWaterMark(_Py_CheckRecursionLimit))
132127

133-
#define Py_ALLOW_RECURSION \
134-
do { unsigned char _old = PyThreadState_GET()->recursion_critical;\
135-
PyThreadState_GET()->recursion_critical = 1;
128+
#define Py_ALLOW_RECURSION
136129

137-
#define Py_END_ALLOW_RECURSION \
138-
PyThreadState_GET()->recursion_critical = _old; \
139-
} while(0);
130+
#define Py_END_ALLOW_RECURSION
140131

141132
PyAPI_FUNC(const char *) PyEval_GetFuncName(PyObject *);
142133
PyAPI_FUNC(const char *) PyEval_GetFuncDesc(PyObject *);

0 commit comments

Comments
 (0)