1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

malloc: refactored aligned_OK and misaligned_chunk

Renamed aligned_OK to misaligned_mem as to be similar
to misaligned_chunk, and reversed any assertions using
the macro.  Made misaligned_chunk call misaligned_mem after
chunk2mem rather than bitmasking with the malloc alignment
itself, since misaligned_chunk is meant to test the data
chunk itself rather than the header, and the compiler
will optimise the addition so the ternary operator is not
needed.

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
This commit is contained in:
William Hunt
2025-06-25 11:35:05 +00:00
committed by Wilco Dijkstra
parent 53ea6db9fd
commit d1ad959b00
2 changed files with 10 additions and 12 deletions

View File

@ -111,7 +111,7 @@ mem2chunk_check (void *mem, unsigned char **magic_p)
INTERNAL_SIZE_T sz, c;
unsigned char magic;
if (!aligned_OK (mem))
if (misaligned_mem (mem))
return NULL;
p = mem2chunk (mem);