[llvm-branch-commits] [clang] c17fdca - [clang] [Headers] Use the corresponding _aligned_free or __mingw_aligned_free in _mm_free

Martin Storsjö via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Dec 4 01:48:12 PST 2020


Author: Martin Storsjö
Date: 2020-12-04T11:34:12+02:00
New Revision: c17fdca1883ddee94c6b7e055428d4445ab13e42

URL: https://github.com/llvm/llvm-project/commit/c17fdca1883ddee94c6b7e055428d4445ab13e42
DIFF: https://github.com/llvm/llvm-project/commit/c17fdca1883ddee94c6b7e055428d4445ab13e42.diff

LOG: [clang] [Headers] Use the corresponding _aligned_free or __mingw_aligned_free in _mm_free

Differential Revision: https://reviews.llvm.org/D92570

Added: 
    

Modified: 
    clang/lib/Headers/mm_malloc.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/Headers/mm_malloc.h b/clang/lib/Headers/mm_malloc.h
index 0ea32517aea8..933dbaacade5 100644
--- a/clang/lib/Headers/mm_malloc.h
+++ b/clang/lib/Headers/mm_malloc.h
@@ -54,7 +54,13 @@ _mm_malloc(size_t __size, size_t __align)
 static __inline__ void __attribute__((__always_inline__, __nodebug__))
 _mm_free(void *__p)
 {
+#if defined(__MINGW32__)
+  __mingw_aligned_free(__p);
+#elif defined(_WIN32)
+  _aligned_free(__p);
+#else
   free(__p);
+#endif
 }
 #endif
 


        


More information about the llvm-branch-commits mailing list