File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -166,32 +166,33 @@ PyStackRef_CLOSE(_PyStackRef tagged)
166
166
Py_DECREF (PyStackRef_AsPyObjectBorrow (tagged ));
167
167
}
168
168
#else
169
- #define PyStackRef_CLOSE (tagged ) Py_DECREF(PyStackRef_AsPyObjectBorrow(tagged))
169
+ # define PyStackRef_CLOSE (tagged ) Py_DECREF(PyStackRef_AsPyObjectBorrow(tagged))
170
170
#endif
171
171
172
- static inline void
173
- PyStackRef_XCLOSE (_PyStackRef tagged )
174
- {
175
- if (!PyStackRef_IsNull (tagged )) {
176
- PyStackRef_CLOSE (tagged );
177
- }
178
- }
172
+ #define PyStackRef_XCLOSE (stackref ) \
173
+ do { \
174
+ _PyStackRef _tmp = (stackref); \
175
+ if (!PyStackRef_IsNull(_tmp)) { \
176
+ PyStackRef_CLOSE(_tmp); \
177
+ } \
178
+ } while (0);
179
+
179
180
181
+ #ifdef Py_GIL_DISABLED
180
182
static inline _PyStackRef
181
183
PyStackRef_DUP (_PyStackRef tagged )
182
184
{
183
- #ifdef Py_GIL_DISABLED
184
185
if (PyStackRef_IsDeferred (tagged )) {
185
186
assert (PyStackRef_IsNull (tagged ) ||
186
187
_Py_IsImmortal (PyStackRef_AsPyObjectBorrow (tagged )));
187
188
return tagged ;
188
189
}
189
190
Py_INCREF (PyStackRef_AsPyObjectBorrow (tagged ));
190
191
return tagged ;
191
- #endif
192
- Py_INCREF (PyStackRef_AsPyObjectBorrow (tagged ));
193
- return tagged ;
194
192
}
193
+ #else
194
+ # define PyStackRef_DUP (stackref ) PyStackRef_FromPyObjectSteal(Py_NewRef(PyStackRef_AsPyObjectBorrow(stackref)))
195
+ #endif
195
196
196
197
static inline _PyStackRef
197
198
PyStackRef_XDUP (_PyStackRef tagged )
You can’t perform that action at this time.
0 commit comments