You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
the compilation time prompts: The object allocated on the heap may not be aligned 64 #159
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?
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.
Activity
cameron314 commentedon Jul 20, 2024
Can you post the full error message?
lovecomputer888 commentedon Jul 20, 2024
This code:dataQueue = new moodycamel::ReaderWriterQueue(1024);
This is message: C4316 “moodycamel::ReaderWriterQueue<quint8,512>”: 在堆上分配的对象可能不是对齐 64
kth8384 commentedon Apr 11, 2025
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。
cameron314 commentedon Apr 11, 2025
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_CACHELINEbefore including the header to remove the alignment and silence this warning, if you like.