This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] malloc.c fix for MALLOC_ALIGN_MASK tests.
On Thu, 2005-09-15 at 10:30 -0700, Ulrich Drepper wrote:
> Look at the definition of mem2chunk. It doesn't change the alignment.
> MALLOC_ALIGNMENT is 2*SIZE_SZ and just subtracts 2*SIZE_SZ. So, state
> what your problem with the existing code is.
I'm sorry if I wasn't clear enough. The problem occurs on arches that
define MALLOC_ALIGNMENT > 2*SIZE_SZ. In that case, the chunk pointer
will not be aligned to MALLOC_ALIGNMENT since mem2chunk just subtracts
2*SIZE_SZ. This means we cannot test whether our mem pointer is
properly aligned by testing its chunk pointer. We need to test the
mem pointer directly.
Peter