Where can I find documentation on C++ memory alignment across different platforms/compilers?

后端 未结 3 846
星月不相逢
星月不相逢 2021-02-08 19:56

I\'m looking for a good (comprehensive) doc about memory alignment in C++, typical approaches, differences between compilers, and common pitfalls. Just to check if my understand

3条回答
  •  暖寄归人
    2021-02-08 20:31

    Imagine the case where addresses must be 16-byte aligned like for example the PS3. And then imagine that the shift == 1. This would then for sure be a non 16-byte aligned pointer which would not work on this machine.

提交回复
热议问题