[cfe-dev] Is this an over alignment bug for ARM?

Tim Northover via cfe-dev cfe-dev at lists.llvm.org
Thu Feb 18 17:29:12 PST 2016


On 18 February 2016 at 16:32, Zhao, Weiming <weimingz at codeaurora.org> wrote:
> Thanks for the answer.
> So "new" or malloc should guarantee that it returns  a at-least 8-byte aligned "this" pointer, is that correct?

Probably. They need to return something compatible with max_align_t,
which I strongly suspect is 8-byte aligned on Android.

There is a concept of "extended alignment" in the C and C++ standards,
where the user may have to realign the results of malloc manually, or
presumably implement custom new operators. This mostly only applies to
things like AVX-512 vectors though.

Cheers.

Tim.



More information about the cfe-dev mailing list