Closed ghost closed 4 years ago
gcc
reports an error in your code:
error: ‘new’ of type ‘TestAtomicQueue’ with extended alignment 64 [-Werror=aligned-new=]
auto pObject = new TestAtomicQueue;
^~~~~~~~~~~~~~~
note: uses ‘void* operator new(std::size_t)’, which does not have an alignment parameter
note: use ‘-faligned-new’ to enable C++17 over-aligned new support
The error message also contains the solution for your problem.
When you post bug reports you should specify the error message verbatim. "broken here" is less than useful.
The problem occurs when I use the queue under DEBUG mode with memleak checking in MSVC. The excerpt of code like below: