Does Visual Studio C++ 2008/2010 support _mm_malloc
officially? It is defined in malloc.h
but I can't find its description in the MSDN library.
Does VC++ support _mm_malloc?
Asked Answered
Doesn't answer your question directly, but I think you're suppose to use _aligned_malloc
. If my understanding is correct, _mm_malloc
is for Intel compilers.
It's seems to not be officially supported, the msvc "implementation" is just
#define _mm_malloc(a, b) _aligned_malloc(a, b)
so it's pretty much just a matter of whether you want to rely on MS not changing that(a pretty good assumption is they'll keep that around), or provide a similar define when you're compiling for windows. –
Regimentals It should be noted that
_aligned_alloc
is NOT the C11/C++11 aligned_alloc
: the parameters are inverted and _aligned_alloc
is not compatible with free
. –
Boise _mm_malloc/_mm_free
supported in Visual Studio 2013 with using the <malloc.h>
header.
"using the header" - which header? –
Mozambique
@Mozambique The one in the question:
<malloc.h>
–
Mardis See Equivalent C code for _mm_ type functions and, more distantly related, How to allocate aligned memory only using the standard library?
I know how to manually achieve alignment. The question wasn't about it. The first link has nothing to do with my question too. –
Tardigrade
I see - I misunderstood your question. –
Javelin
Doesn't memalign() in <malloc.h>
solve this? The man-page says it's obsolete, but ...
© 2022 - 2024 — McMap. All rights reserved.
_mm_malloc
is supported by gcc, and_aligned_malloc
is not. Microsoft compiler seems to be support it too, but I can't find any official paper about it. – Tardigrade