[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

@ -256,19 +256,11 @@ static blk_t next_bad = 0;
static bb_badblocks_iterate bb_iter = NULL;
static __inline void *allocate_buffer(size_t size) {
#ifdef __MINGW32__
return __mingw_aligned_malloc(size, BB_SYS_PAGE_SIZE);
#else
return _aligned_malloc(size, BB_SYS_PAGE_SIZE);
#endif
return _mm_malloc(size, BB_SYS_PAGE_SIZE);
}
static __inline void free_buffer(void* p) {
#ifdef __MINGW32__
__mingw_aligned_free(p);
#else
_aligned_free(p);
#endif
_mm_free(p);
}
/*