tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Alignment of small memory allocations returned by malloc(3)



On Sat, Feb 01, 2014 at 01:16:54PM +0000, David Laight wrote:
> But gcc is assuming the maximal alignment for 'normal' items - which
> ends up being 16 bytes for long double on some systems.

This is not about gcc, but the C standard and our malloc - Nick's patch
makes most ports use 4 byte alignement for small malloc sizes.

The gcc macro for this came in "late" and many target configurations
have not properly overwritten it, the default is there to err on the
safe side.

We will, of course, fix the in-tree gcc to assume the same alignemnt
our malloc provides.

Martin


Home | Main Index | Thread Index | Old Index