Skip to content

Commit

Permalink
Remove unnecessary assertion from aligned_alloc (#658)
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 authored May 23, 2024
1 parent d9bca64 commit b1d0d7d
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 @@ -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);
}

Expand Down

0 comments on commit b1d0d7d

Please sign in to comment.