Conversation
Reports padding holes in cdef class and cdef struct declarations, and the field order that removes them. A .pxd has one field order for every platform we ship to, so all four ABIs are checked at once: `long` is 4 bytes under LLP64 and pointers halve on 32-bit, which means a layout that packs tightly on lp64 can still have holes on Windows. The suggested order is the one that measures smallest across every ABI, not the best for any single one, and the declared order wins ties so a reshuffle is only proposed when it buys something. Sizing a cdef class needs two things that are not in the .pxd: PyObject_HEAD, and the hidden __pyx_vtab pointer Cython places after it in the topmost class that declares a cdef method. With both modelled, the computed sizes match tp_basicsize for all 58 cdef classes in av. Run it with `make pxdpad`, also wired into the smoke workflow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.