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

Rust does not expose padding #1

Open
Avi-D-coder opened this issue Jun 7, 2020 · 0 comments
Open

Rust does not expose padding #1

Avi-D-coder opened this issue Jun 7, 2020 · 0 comments

Comments

@Avi-D-coder
Copy link
Owner

This is not good, I was planning on using padding to contain the traced bit. Without a traced bit trace must fallback to a lookup.
On unpadded structs the plan is to add a probabilistic bit set by the header, but this will never be in the same cache line as the struct being traced.
A faster cache friendly UB workaround might be adding a const unpadded to Traceequal to the sum of size_of for all fields.

https://users.rust-lang.org/t/size-of-type-without-alignment-padding/24183/5
rust-lang/rfcs#1397

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

No branches or pull requests

1 participant