Skip to content

Niche filling opportunity if len's alignment is less than T's alignment #265

@chadaustin

Description

@chadaustin

Specifically, I have an ArrayVec<core::task::Waker, 15>. Waker is two pointers, and len is 32 bits. On 64-bit platforms, in theory, Option<ArrayVec<...>> could have the same size.

But padding cannot be used to hold discriminants unless you explicitly allocate said padding.

I think this would require some compile-time selection based on the alignment of T. Not urgent, but something I noticed when examining code generation.

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