compiler: Get rid of slops in structs#91458
Merged
brandtbucher merged 1 commit intopython:mainfrom Apr 13, 2022
Merged
Conversation
brandtbucher
approved these changes
Apr 11, 2022
Member
brandtbucher
left a comment
There was a problem hiding this comment.
Thanks! Found one minor whitespace issue, otherwise looks good:
Regain space lost due to alignment by reordering structs from larger to
smaller members and not intertwining bitfields with full-size fields.
With this change, the sizes are now:
Struct Size before Size after
assembler 104 96
basicblock_ 64 56
(Sizes measured on x86-64 Linux, using pahole[1] and this handy
script[2] that compares struct sizes between versions.)
No functional changes expected. Structs are used only internally.
[1] https://github.com/acmel/dwarves
[2] https://gist.github.com/mdboom/6052da76e152ccc9dc6b9741a7ddd6c6
655570f to
51f3f3d
Compare
Member
|
You can also add your name to |
|
@brandtbucher: Please replace |
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.
Regain space lost due to alignment by reordering structs from larger to smaller members and not intertwining bitfields with full-size fields.
With this change, the sizes are now:
Sizes measured on x86-64 Linux, using pahole and this handy script that compares struct sizes between versions.
I don't think this warrants an issue, as it just rearranges members inside the
compile.ctranslation unit.