Skip to content

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Jan 3, 2023

…code object into the new function _PyCode_GetNumFrameSlots
@iritkatriel iritkatriel added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jan 3, 2023
Copy link
Member

@gvanrossum gvanrossum left a 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.

Copy link
Member

@markshannon markshannon left a 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.

}

int
_PyCode_GetNumFrameSlots(PyCodeObject *code)
Copy link
Member

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.

Copy link
Member Author

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.

@iritkatriel iritkatriel changed the title gh-100720: refactor calculation of number of frame slots for a code object into the new function _PyCode_GetNumFrameSlots gh-100720: refactor calculation of number of frame slots for a code object into the new function _PyFrame_NumSlotsForCodeObject Jan 4, 2023
@iritkatriel iritkatriel merged commit c31e356 into python:main Jan 4, 2023
@iritkatriel iritkatriel deleted the num_registers branch July 25, 2023 18:08
@iritkatriel iritkatriel restored the num_registers branch July 25, 2023 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add _PyFrame_NumSlotsForCodeObject()
4 participants