arrayvec icon indicating copy to clipboard operation
arrayvec copied to clipboard

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

Open chadaustin opened this issue 9 months ago • 0 comments

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.

chadaustin avatar May 11 '24 23:05 chadaustin