This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] elf: dl-minimal malloc needs to respect fundamental alignment

On 06/21/2016 03:20 PM, H.J. Lu wrote:
On Tue, Jun 21, 2016 at 6:06 AM, Florian Weimer <> wrote:
On 06/21/2016 03:00 PM, H.J. Lu wrote:

MALLOC_ALIGNMENT is potentially larger.  malloc/tst-malloc-thread-fail
for alignment.  To my knowledge, it passes on all regularly tested
architectures after commit dea39b13e2958a7f0e75b5594a06d97d61cc439f.

MALLOC_ALIGNMENT is kind of mapped to the malloc alignment of
a psABI.  Shouldn't malloc have the same alignment of libc malloc?

I don't see why.  MALLOC_ALIGNMENT has to match both the ABI constraint and
the malloc/malloc.c implementation constraint (which requires a minimum
alignment of 2 * sizeof (size_t)).

My understanding is since the minimum constraint of malloc alignment
<= ABI alignment, MALLOC_ALIGNMENT == ABI alignment.  Do you
have a glibc platform where it isn't true?

If I'm not mistaken, m68k has fundamental alignment 2 (the alignment of long, double, and long double), but our malloc still aligns to 8 (2 * sizeof (size_t)).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]