-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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-100720: refactor calculation of number of frame slots for a code object into the new function _PyFrame_NumSlotsForCodeObject #100722
Conversation
…code object into the new function _PyCode_GetNumFrameSlots
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.
LGTM, but let's ask @markshannon.
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.
Looks good, but I think _PyCode_GetNumFrameSlots
should be an inline function.
Objects/codeobject.c
Outdated
@@ -1520,6 +1520,15 @@ PyCode_GetFreevars(PyCodeObject *code) | |||
return _PyCode_GetFreevars(code); | |||
} | |||
|
|||
int | |||
_PyCode_GetNumFrameSlots(PyCodeObject *code) |
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.
This should probably be a static inline function.
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.
Yeah. I also think it belongs in pycore_frame.h rather than pycore_code.h.
…to pycore_frame.h and make it static inline
Fixes #100720.