mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
gh-124218: Use per-thread refcounts for code objects (#125216)
Use per-thread refcounting for the reference from function objects to their corresponding code object. This can be a source of contention when frequently creating nested functions. Deferred refcounting alone isn't a great fit here because these references are on the heap and may be modified by other libraries.
This commit is contained in:
parent
206de4155b
commit
3ea488aac4
11 changed files with 126 additions and 83 deletions
|
@ -20,7 +20,7 @@
|
|||
#include "pycore_runtime_init.h" // _PyRuntimeState_INIT
|
||||
#include "pycore_sysmodule.h" // _PySys_Audit()
|
||||
#include "pycore_obmalloc.h" // _PyMem_obmalloc_state_on_heap()
|
||||
#include "pycore_uniqueid.h" // _PyType_FinalizeThreadLocalRefcounts()
|
||||
#include "pycore_uniqueid.h" // _PyObject_FinalizePerThreadRefcounts()
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
CAUTION
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue