b2StackAllocator data alignment issue ?

Hello,

I am far from being a C++ expert but I wonder if you can potentially mis-align data structure with the Allocate method ?
On GCC and VSS, the data structure will probably be padded so calling Allocate with a sizeof should not be an issue....but I wonder if there can be an issue with 64bits system, stacking first a 32bits padded struct then a 64bits one.
I've wondered about misalignment too. The C++ b2StackAllocator code seems to be open to this potential when allocating memory from its internal buffer (when 'usedMalloc' is false). OTOH, some architectures don't care about alignment. But it's the ones that do that concern me. Some provide slower access to misaligned memory while others of these will outright abort the code being executed.

I'm guessing that this hasn't been a problem because the sizes that get requested from the stack allocator have conveniently lined up (and not left the 'm_index' value a non-multiple of the memory alignment).

Original thread: https://box2d.org/forum/viewtopic.php?t=6300