the compilation time prompts: The object allocated on the heap may not be aligned 64
After using the following statement ReaderWriterQueue<int> q(100);
, the compilation time prompts: The object allocated on the heap may not be aligned 64, I use MSVC(ver2022,c++14) to develop, how to solve it?
Can you post the full error message?
This code:dataQueue = new moodycamel::ReaderWriterQueue
I have the same warning when use std::make_shared to create a object of moodycamel::BlockingReaderWriterQueuestd::string , or use std::make_shared to create a object who has an attribute of moodycamel::BlockingReaderWriterQueuestd::string。
For objects allocated on the heap this can be normal. It's not a problem if the alignment to 64 is not respected, it's just a hint to potentially improve performance. You can define MOODYCAMEL_MAYBE_ALIGN_TO_CACHELINE before including the header to remove the alignment and silence this warning, if you like.