Skip to content

Commit

Permalink
Remove unnecessary assertion from aligned_alloc
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mjp41 committed May 23, 2024
1 parent 126e77f commit 84ba654
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/snmalloc/override/libc.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ namespace snmalloc::libc

inline void* aligned_alloc(size_t alignment, size_t size)
{
SNMALLOC_ASSERT((size % alignment) == 0);
return memalign(alignment, size);
}

Expand Down

0 comments on commit 84ba654

Please sign in to comment.