Does VC++ support _mm_malloc?
Asked Answered
T

4

7

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.

Tardigrade answered 22/7, 2010 at 6:28 Comment(0)
C
4

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.

Cyanate answered 22/7, 2010 at 7:15 Comment(3)
_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
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
M
2

_mm_malloc/_mm_free supported in Visual Studio 2013 with using the <malloc.h> header.

Mardis answered 16/6, 2015 at 20:38 Comment(2)
"using the header" - which header?Mozambique
@Mozambique The one in the question: <malloc.h>Mardis
J
0

See Equivalent C code for _mm_ type functions and, more distantly related, How to allocate aligned memory only using the standard library?

Javelin answered 19/1, 2011 at 19:10 Comment(2)
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
C
0

Doesn't memalign() in <malloc.h> solve this? The man-page says it's obsolete, but ...

Christhood answered 19/1, 2011 at 19:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.