File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,9 @@ namespace greenlet
110
110
_PyCFrame* cframe;
111
111
int use_tracing;
112
112
#endif
113
- #if GREENLET_PY312
113
+ #if GREENLET_PY314
114
+ int py_recursion_depth;
115
+ #elif GREENLET_PY312
114
116
int py_recursion_depth;
115
117
int c_recursion_depth;
116
118
#else
Original file line number Diff line number Diff line change @@ -12,7 +12,9 @@ PythonState::PythonState()
12
12
,cframe(nullptr )
13
13
,use_tracing(0 )
14
14
#endif
15
- #if GREENLET_PY312
15
+ #if GREENLET_PY314
16
+ ,py_recursion_depth(0 )
17
+ #elif GREENLET_PY312
16
18
,py_recursion_depth(0 )
17
19
,c_recursion_depth(0 )
18
20
#else
@@ -132,7 +134,9 @@ void PythonState::operator<<(const PyThreadState *const tstate) noexcept
132
134
#endif
133
135
#endif // GREENLET_USE_CFRAME
134
136
#if GREENLET_PY311
135
- #if GREENLET_PY312
137
+ #if GREENLET_PY314
138
+ this ->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining ;
139
+ #elif GREENLET_PY312
136
140
this ->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining ;
137
141
this ->c_recursion_depth = Py_C_RECURSION_LIMIT - tstate->c_recursion_remaining ;
138
142
#else // not 312
@@ -207,7 +211,10 @@ void PythonState::operator>>(PyThreadState *const tstate) noexcept
207
211
#endif
208
212
#endif // GREENLET_USE_CFRAME
209
213
#if GREENLET_PY311
210
- #if GREENLET_PY312
214
+ #if GREENLET_PY314
215
+ tstate->py_recursion_remaining = tstate->py_recursion_limit - this ->py_recursion_depth ;
216
+ this ->unexpose_frames ();
217
+ #elif GREENLET_PY312
211
218
tstate->py_recursion_remaining = tstate->py_recursion_limit - this ->py_recursion_depth ;
212
219
tstate->c_recursion_remaining = Py_C_RECURSION_LIMIT - this ->c_recursion_depth ;
213
220
this ->unexpose_frames ();
@@ -253,7 +260,9 @@ inline void PythonState::will_switch_from(PyThreadState *const origin_tstate) no
253
260
void PythonState::set_initial_state (const PyThreadState* const tstate) noexcept
254
261
{
255
262
this ->_top_frame = nullptr ;
256
- #if GREENLET_PY312
263
+ #if GREENLET_PY314
264
+ this ->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining ;
265
+ #elif GREENLET_PY312
257
266
this ->py_recursion_depth = tstate->py_recursion_limit - tstate->py_recursion_remaining ;
258
267
// XXX: TODO: Comment from a reviewer:
259
268
// Should this be ``Py_C_RECURSION_LIMIT - tstate->c_recursion_remaining``?
You can’t perform that action at this time.
0 commit comments