mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
gh-123923: Defer refcounting for f_executable in _PyInterpreterFrame (#123924)
Use a `_PyStackRef` and defer the reference to `f_executable` when possible. This avoids some reference count contention in the common case of executing the same code object from multiple threads concurrently in the free-threaded build.
This commit is contained in:
parent
4ed7d1d6ac
commit
b2afe2aae4
18 changed files with 177 additions and 99 deletions
|
|
@ -534,6 +534,13 @@ visit_decref(PyObject *op, void *parent)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
_PyGC_VisitStackRef(_PyStackRef *ref, visitproc visit, void *arg)
|
||||
{
|
||||
Py_VISIT(PyStackRef_AsPyObjectBorrow(*ref));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
_PyGC_VisitFrameStack(_PyInterpreterFrame *frame, visitproc visit, void *arg)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue