[misc] use the more univerasal _mm_alloc() instead of _aligned_malloc()

* Also ensure that our buffers are aligned
* Also remove the use of static buffers in ms-sys
This commit is contained in:
Pete Batard 2016-06-10 12:42:43 +01:00
parent 3fdf622933
commit e76f60a3e8
11 changed files with 125 additions and 113 deletions

View file

@ -94,6 +94,7 @@
#define CHECK_FOR_USER_CANCEL if (IS_ERROR(FormatStatus)) goto out
#define safe_free(p) do {free((void*)p); p = NULL;} while(0)
#define safe_mm_free(p) do {_mm_free((void*)p); p = NULL;} while(0)
#define safe_min(a, b) min((size_t)(a), (size_t)(b))
#define safe_strcp(dst, dst_max, src, count) do {memcpy(dst, src, safe_min(count, dst_max)); \
((char*)dst)[safe_min(count, dst_max)-1] = 0;} while(0)