diff options
author | Mark Shannon <mark@hotpy.org> | 2022-12-09 12:18:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-09 12:18:45 (GMT) |
commit | fb713b21833a17cba8022af0fa4c486512157d4b (patch) | |
tree | 2e75f1e59393160792f1097846a648ff7927de8d /Programs | |
parent | 3c5355496b54fa0a4ea0e22344d008528e45682c (diff) | |
download | cpython-fb713b21833a17cba8022af0fa4c486512157d4b.zip cpython-fb713b21833a17cba8022af0fa4c486512157d4b.tar.gz cpython-fb713b21833a17cba8022af0fa4c486512157d4b.tar.bz2 |
GH-98522: Add version number to code objects. (GH-98525)
* Add version number to code object for better versioning of functions.
* Improves specialization for closures and list comprehensions.
Diffstat (limited to 'Programs')
-rw-r--r-- | Programs/_bootstrap_python.c | 2 | ||||
-rw-r--r-- | Programs/_freeze_module.c | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/Programs/_bootstrap_python.c b/Programs/_bootstrap_python.c index bbac0c4..6e1593a 100644 --- a/Programs/_bootstrap_python.c +++ b/Programs/_bootstrap_python.c @@ -14,6 +14,8 @@ #include "Python/frozen_modules/importlib._bootstrap_external.h" /* End includes */ +uint32_t _Py_next_func_version = 1; + /* Empty initializer for deepfrozen modules */ int _Py_Deepfreeze_Init(void) { diff --git a/Programs/_freeze_module.c b/Programs/_freeze_module.c index 9e2169f..90fc2dc 100644 --- a/Programs/_freeze_module.c +++ b/Programs/_freeze_module.c @@ -9,6 +9,7 @@ Keep this file in sync with Programs/_freeze_module.py. */ + #include <Python.h> #include <marshal.h> #include "pycore_fileutils.h" // _Py_stat_struct @@ -22,6 +23,8 @@ #include <unistd.h> #endif +uint32_t _Py_next_func_version = 1; + /* Empty initializer for deepfrozen modules */ int _Py_Deepfreeze_Init(void) { |