I feel this, plus an FFI that lets you specify parameter alignment tags*, and pin the arguments accordingly, would be an excellent solution.
For example, AVX ops already requires 32-byte alignment.
Covering all the cases where alignment might be an issue seems like a hefty task for the allocator to care about by default.
Might be a good idea to make sure they're padded to a corresponding multiple of bytes as well, just to be safe :)
(Say, some library using movapd to store the results back as well, without regarding odd-numbers of elements, thus potentially overwriting the next objects header)
Cheers,
Henry
P.S. For the record, alignment isn't ever an issue when writing your own SSE functions using NB. You'd simply
\\16/32 the provided pointer, do aligned loads, and mask out the leading/trailing bytes when storing using maskmovdqu/vmaskmov** ;)
*A custom FFI interrupt handler for #GP returning an error instead of crashing when an alignment tag is missing would be out of the question though, right? ;)
** Well, if someone gets around to implementing the VEX-encoded instructions in NB, that is