[cfe-dev] C++ Operator new alignment requirements

Bernhard Walle via cfe-dev cfe-dev at lists.llvm.org
Fri Sep 29 08:11:44 PDT 2017


Hello,

to be honest, I'm not sure if this is the right list since it's not the C/C++ parser but the machine code generator.

Background: We have our own overloaded operator new for some historic reason. We saw that the pointer has a hard 16 byte alignment requirement since the compiler uses SSE instructions to zero the memory in some circumstances. 

Does the C++ standard require that alignment?

I read that both Linux and Windows malloc return a 2*sizeof(void*) alignment, so maybe we're the first that notice that requirement.

Regards,
Bernhard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170929/8b87aa02/attachment.html>


More information about the cfe-dev mailing list