mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-123923: Defer refcounting for f_funcobj
in _PyInterpreterFrame
(#124026)
Use a `_PyStackRef` and defer the reference to `f_funcobj` 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
d3c76dff44
commit
f4997bb3ac
17 changed files with 143 additions and 137 deletions
|
@ -533,7 +533,7 @@ translate_bytecode_to_trace(
|
|||
{
|
||||
bool first = true;
|
||||
PyCodeObject *code = _PyFrame_GetCode(frame);
|
||||
PyFunctionObject *func = (PyFunctionObject *)frame->f_funcobj;
|
||||
PyFunctionObject *func = _PyFrame_GetFunction(frame);
|
||||
assert(PyFunction_Check(func));
|
||||
PyCodeObject *initial_code = code;
|
||||
_Py_BloomFilter_Add(dependencies, initial_code);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue