Skip to content

Rust does not expose padding #1

@Avi-D-coder

Description

@Avi-D-coder

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions