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

Use NonZeroU64 in the new InlineArray so the compiler can optimize around it #1508

Open
AaronKutch opened this issue Jun 21, 2024 · 0 comments
Labels

Comments

@AaronKutch
Copy link

I notice that the new InlineArray is based on a [u8; 8] that then gets converted to its different kinds. Its base representation should be a NonZero, since it appears that all valid bit patterns of it are intended to be nonzero. The compiler can then optimize things like Option<NonZeroU64> to be only u64 sized and greatly improve the padding of structs that use it.

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

No branches or pull requests

1 participant