mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
gh-117657: Disable the function/code cache in free-threaded builds (#118301)
This is only used by the specializing interpreter and the tier 2 optimizer, both of which are disabled in free-threaded builds.
This commit is contained in:
parent
5248596781
commit
37d0950022
4 changed files with 23 additions and 1 deletions
|
@ -416,10 +416,16 @@ init_code(PyCodeObject *co, struct _PyCodeConstructor *con)
|
|||
co->co_ncellvars = ncellvars;
|
||||
co->co_nfreevars = nfreevars;
|
||||
PyInterpreterState *interp = _PyInterpreterState_GET();
|
||||
#ifdef Py_GIL_DISABLED
|
||||
PyMutex_Lock(&interp->func_state.mutex);
|
||||
#endif
|
||||
co->co_version = interp->func_state.next_version;
|
||||
if (interp->func_state.next_version != 0) {
|
||||
interp->func_state.next_version++;
|
||||
}
|
||||
#ifdef Py_GIL_DISABLED
|
||||
PyMutex_Unlock(&interp->func_state.mutex);
|
||||
#endif
|
||||
co->_co_monitoring = NULL;
|
||||
co->_co_instrumentation_version = 0;
|
||||
/* not set */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue