DST Vector Alignment


#1

I’m trying to create a DST Vector with the following layout:

(low)
// Data (vtable, data pairs).
*const a_vtable
a_data
*const b_vtable
b_data
...
...
// Offsets
b_end
b_start/a_end
a_start
(high)

However, heap allocation methods take an alignment argument and, as I’m planning on storing structs of different types in the same array, I don’t know what that alignment should be. Are their any safe universal alignments (e.g. size_of::<usize>())?


#2

SIMD types have alignment greater than the alignment of usize.