On Sat, 5 Dec 2020, Liu Hao wrote:

在 2020/12/4 下午3:44, Martin Storsjö 写道:
Instead just remove the _mm_malloc redefinition and include the
compiler's mm_malloc.h header. This makes sure that regardless of
header include order, calls to _aligned_malloc and _mm_malloc will
always end up to the same function, avoiding risks of mismatches
between *_malloc and *_free.

Is it a good idea to `#include <mm_malloc.h>` directly? AFAICT it's a 
non-standard header and MSVC
does not have it.

My thought here was that previously by including malloc.h, you got a working _mm_malloc and _mm_free (defined by pointing at other functions), so there could be code relying on getting these functions visible by just relying on malloc.h. (The fact that MSVC doesn't have it shouldn't really matter afaik, as our headers don't support being built with MSVC in general afaik?)

The Intel Intrinsics Guide [1] says those functions are of SSE
technology and
suggests `#include <xmmintrin.h>` instead.

I guess that'd work, but that ends up declaring a whole lot more than what the header did earlier.

// Martin

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to