From b1d0d7dc78d8d75d6f8729772df6207a0cc37c66 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 23 May 2024 16:07:01 +0100 Subject: [PATCH] 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. --- src/snmalloc/override/libc.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/snmalloc/override/libc.h b/src/snmalloc/override/libc.h index a7fd21187..587d94ac2 100644 --- a/src/snmalloc/override/libc.h +++ b/src/snmalloc/override/libc.h @@ -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); }