Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
-
None
Description
inline void* aligned_malloc(size_t size, size_t align) { |
void *result; |
#ifdef _MSC_VER
|
result = _aligned_malloc(size, align);
|
#elif defined (HAVE_POSIX_MEMALIGN)
|
if(posix_memalign(&result, align, size)) { |
result = 0;
|
}
|
#else
|
/* Use unaligned malloc as fallback */ |
result = malloc(size); |
#endif
|
return result; |
}
|
This function should always return aligned buffer, as it's name states.