mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +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
|
@ -4,6 +4,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "pycore_lock.h"
|
||||
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
|
@ -24,6 +26,11 @@ struct _func_version_cache_item {
|
|||
};
|
||||
|
||||
struct _py_func_state {
|
||||
#ifdef Py_GIL_DISABLED
|
||||
// Protects next_version
|
||||
PyMutex mutex;
|
||||
#endif
|
||||
|
||||
uint32_t next_version;
|
||||
// Borrowed references to function and code objects whose
|
||||
// func_version % FUNC_VERSION_CACHE_SIZE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue