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

Add @inline to Base.reinterpret #57078

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jakobnissen
Copy link
Contributor

Reinterpret contains quite a bit of code to handle padding, and so doesn't usually inline for structs. However, it frequently compiles down to a noop, making an inline unusually valuable.

@jakobnissen
Copy link
Contributor Author

One consideration is that reinterpret does expand to a fair bit of code if !Base.struct_subpadding(T, T2), and this change also inlines that case. One possibility is to refactor _reinterpret so that the noop case and the more complex case are two distinct functions, and only inline the latter.

@jakobnissen
Copy link
Contributor Author

Test failures are unrelated

Reinterpret contains quite a bit of code to handle padding, and so doesn't
usually inline for structs. However, it frequently compiles down to a noop,
making an inline unusually valuable.
@jakobnissen jakobnissen added the status: waiting for PR reviewer PR is complete and seems ready to merge. Has tests and news/compat if needed. CI failures unrelated. label Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for PR reviewer PR is complete and seems ready to merge. Has tests and news/compat if needed. CI failures unrelated.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant