On 10/21/21 3:28 AM, John Scott via Libc-alpha wrote: > I'm not subscribed; please CC me. > Carlos asked me offline to comment on this change. I'm not a Glibc expert so I'll do my best but I defer to others here who know the allocator much better. diff --git a/manual/memory.texi b/manual/memory.texi index 0b2b9c87..5c16f7ae 100644 --- a/manual/memory.texi +++ b/manual/memory.texi @@ -995,7 +995,7 @@ power of two than that, use @code{aligned_alloc} or @code{posix_memalign}. @c Alias to memalign. The @code{aligned_alloc} function allocates a block of @var{size} bytes whose address is a multiple of @var{alignment}. The @var{alignment} must be a -power of two and @var{size} must be a multiple of @var{alignment}. +power of two. Based on my code inspection of _mid_memalign in malloc.c I think a change that would more accurately reflect the implementation is one that described that when alignment is not a power of two it's bumped up to next larger power of two, and adjusted the EINVAL condition appropriately. Attached is a diff along these lines. Please feel free to use it as you see fit. Martin