add alignment check to aligned_alloc for C11 compliance
This commit is contained in:
parent
0aec6d9302
commit
7b63bc4211
@ -71,6 +71,7 @@ void* mi_pvalloc(size_t size) mi_attr_noexcept {
|
||||
}
|
||||
|
||||
void* mi_aligned_alloc(size_t alignment, size_t size) mi_attr_noexcept {
|
||||
if (alignment != 0 && (size%alignment) != 0) return NULL; // C11 required; <https://en.cppreference.com/w/c/memory/aligned_alloc>
|
||||
return mi_malloc_aligned(size, alignment);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user