Remove unnecessary assertion from aligned_alloc (#658)

With [DR460](https://open-std.org/JTC1/SC22/WG14/www/docs/summary.htm#dr_460) the undefined behaviour for size not being a multiple of alignment was remove.

The [N2072](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2072.htm) allows for this to return memory.

So we can remove this assert and keep the same conditions as memalign.
This commit is contained in:
Matthew Parkinson
2024-05-23 16:07:01 +01:00
committed by GitHub
parent d9bca64426
commit b1d0d7dc78

View File

@@ -156,7 +156,6 @@ namespace snmalloc::libc
inline void* aligned_alloc(size_t alignment, size_t size)
{
SNMALLOC_ASSERT((size % alignment) == 0);
return memalign(alignment, size);
}