[vlc-commits] [Git][videolan/vlc][master] compat: always use _aligned_malloc/_aligned_free on Windows

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Apr 6 17:25:08 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
d91e21ae by Steve Lhomme at 2023-04-06T17:12:47+00:00
compat: always use _aligned_malloc/_aligned_free on Windows

We don't need the mingw custom code. It's available in msvcrt.dll and UCRT. It's better
to use the same code between mingw and MSVC builds.

- - - - -


2 changed files:

- compat/aligned_alloc.c
- include/vlc_fixups.h


Changes:

=====================================
compat/aligned_alloc.c
=====================================
@@ -56,9 +56,7 @@ void *aligned_alloc(size_t align, size_t size)
 
 #elif defined(HAVE_MEMALIGN)
     return memalign(align, size);
-#elif defined (_WIN32) && defined(__MINGW32__)
-    return __mingw_aligned_malloc(size, align);
-#elif defined (_WIN32) && defined(_MSC_VER)
+#elif defined (_WIN32)
     return _aligned_malloc(size, align);
 #else
     /* align must be valid/supported */


=====================================
include/vlc_fixups.h
=====================================
@@ -396,9 +396,7 @@ void *aligned_alloc(size_t, size_t);
 } /* extern "C" */
 #endif
 
-#if defined (_WIN32) && defined(__MINGW32__)
-#define aligned_free(ptr)  __mingw_aligned_free(ptr)
-#elif defined (_WIN32) && defined(_MSC_VER)
+#if defined (_WIN32)
 #define aligned_free(ptr)  _aligned_free(ptr)
 #else
 #define aligned_free(ptr)  free(ptr)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/d91e21aec08133479a38686a1ace84638731a4f4

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/d91e21aec08133479a38686a1ace84638731a4f4
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list