Do I really have to worry about alignment when using placement new operator?

后端 未结 5 1707
南笙
南笙 2020-12-05 00:43

I read this When should I worry about alignment? but I am still do not know if I have to worry about not aligned pointer returned by placement new operator - like in this e

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 01:06

    a quick google tells me that gcc on powerpc has an option to tell the compiler if unaligned accesses are handeled by the system or not.

    I would assume that in either case unaligned accesses on that platform will be very slow, and should be avoided as much as possible.

提交回复
热议问题