Visitar URL original
gh-93585: Set PyCode_Type.tp_basicsize to sizeof(PyCodeObject) by vstinner · Pull Request #93587 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20220607170602/https://github.com/python/cpython/pull/93587
Skip to content
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-93585: Set PyCode_Type.tp_basicsize to sizeof(PyCodeObject) #93587

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jun 7, 2022

Cython makes the assumption that PyCode_Type.tp_basicsize equals to
sizeof(PyCodeObject). This assumption is no longer true since the
commit 2bde682. Restore tp_basicsize
until the PyCodeObject structure can use a C99 flexible array of size
zero with the syntax "char co_code_adaptive[]".

Cython makes the assumption that PyCode_Type.tp_basicsize equals to
sizeof(PyCodeObject). This assumption is no longer true since the
commit 2bde682. Restore tp_basicsize
until the PyCodeObject structure can use a C99 flexible array of size
zero with the syntax "char co_code_adaptive[]".
Copy link
Member

@encukou encukou left a comment

There is no reason to waste one _Py_CODEUNIT of memory per code object. Cython should update its check.

@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Jun 7, 2022

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@vstinner
Copy link
Member Author

@vstinner vstinner commented Jun 7, 2022

See #93585 (comment) for the rationale for this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants