warning C4316: object allocated on the heap may not be aligned 16

后端 未结 4 726
面向向阳花
面向向阳花 2020-12-30 01:16

Important Information:

  • Development OS: Windows 8.1 64 bit
  • Target OS: Windows 8.1 64 bit
  • IDE: Visual Studio 2013 Professional
4条回答
  •  太阳男子
    2020-12-30 01:55

    If you look at the pre-processed code you'll probably find something like this __declspec(align(16)) in there, requesting to be aligned at 16 bytes while new may not align at that constraint. Accoding to http://msdn.microsoft.com/en-us/library/vstudio/dn448573.aspx you can fix it by Override operator new and operator delete for over-aligned types so that they use the aligned allocation routines—for example, _aligned_malloc and _aligned_free.

提交回复
热议问题