Repository navigation
gh-95756: Lazily created cached co_* attrs - #97791
Conversation
|
Note that these were all O(1) in 3.10. This restores their behavior. They also previously returned just incref of a cache. |
|
I'd like to reduce the size of code objects for a few reasons. PEP 649 will create lots of small code objects and we want multiple interpreters to share as much data as possible. |
|
I'm merging this, as we can add the line array, and any other tables needed in unusual cases, to the |
|
When you're done making the requested changes, leave the comment: |
| if (*cached_field != NULL) { | ||
| return Py_NewRef(*cached_field); | ||
| } | ||
| assert(*cached_field == NULL); |
There was a problem hiding this comment.
No need to assert this. The test two lines above ensures that it is true.
markshannon
left a comment
There was a problem hiding this comment.
One assert that could be removed, but it's harmless.
|
I'll leave the assert in since it communicates some info should the code change in the future. And like you mentioned it's harmless anyways. |
|
|
I'm confused. Why is this the only buildbot failing? In any case I might revert this within 24 hours. |
I created #98178 about this crash. It seems to be specific to macOS and unrelated to your change. If your change would introduce a bug, more tests would crash on more platforms. |
As long as these aren't accessed, they don't actually consume additional space over 3.11.