-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-98522: Add version number to code objects, to provide better version numbers for closures and comprehensions. #98525
Conversation
@@ -472,6 +472,8 @@ typedef struct _PyShimCodeDef { | |||
extern PyCodeObject * | |||
_Py_MakeShimCode(const _PyShimCodeDef *code); | |||
|
|||
extern uint32_t _Py_next_func_version; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why this is called func_version and not code_version? I find it a bit confusing (note that in deepfreeze.py we now have _Py_next_func_version = {next_code_version}
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is primarily used as the version for functions.
https://github.com/python/cpython/blob/main/Python/bytecodes.c#L2976
Caching it in the code object is a further optimization.
✅ Deploy Preview for python-cpython-preview canceled.
|
Address sanitizer test failing itself because its too slow 🤨 |
Measured performance impact might be positive but is too close to noise to be meaningful.