mirror of
https://github.com/python/cpython.git
synced 2025-10-14 18:59:46 +00:00
gh-125323: Remove some unsafe Py_DECREFs in bytecodes.c, replacing them with PyStackRef_CLOSEs (GH-125324)
This commit is contained in:
parent
b52c7306ea
commit
4b358ee647
6 changed files with 65 additions and 60 deletions
|
@ -153,6 +153,8 @@ PyStackRef_AsStrongReference(_PyStackRef stackref)
|
|||
return PyStackRef_FromPyObjectSteal(PyStackRef_AsPyObjectSteal(stackref));
|
||||
}
|
||||
|
||||
#define PyStackRef_CLOSE_SPECIALIZED(stackref, dealloc) PyStackRef_CLOSE(stackref)
|
||||
|
||||
|
||||
#else // Py_GIL_DISABLED
|
||||
|
||||
|
@ -177,6 +179,7 @@ static const _PyStackRef PyStackRef_NULL = { .bits = 0 };
|
|||
|
||||
#define PyStackRef_DUP(stackref) PyStackRef_FromPyObjectSteal(Py_NewRef(PyStackRef_AsPyObjectBorrow(stackref)))
|
||||
|
||||
#define PyStackRef_CLOSE_SPECIALIZED(stackref, dealloc) _Py_DECREF_SPECIALIZED(PyStackRef_AsPyObjectBorrow(stackref), dealloc)
|
||||
|
||||
#endif // Py_GIL_DISABLED
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue