[PATCH] MALLOC_ABI_ALIGNMENT macro + malloc-alignment param
Olivier Hainque
hainque@adacore.com
Fri Jul 18 16:40:00 GMT 2008
Richard Guenther wrote:
> I suggest to add a target macro that specifies the minimal alignment
> a C conformant malloc implementation has to provide.
Fine with me :)
I had used MALLOC_ABI_ALIGNMENT as the name lately. Fine with you ?
> This would for example be 4 on i?86-linux (even though the glibc
> implementation provides 8 I think) and 8 on x86_64-linux.
> The default value for the target macro should be 1 for safety,
> though eventually 4 for ilp32 and 8 for lp64 targets would do as
> well.
LONG_TYPE_SIZE ?
> The malloc_align function attribute is a separate thing and you
> don't need to bother about it.
Understood,
> I don't think we should have a --param to override the values.
OK. I thought it was a nice idea, providing a convenient device
at a very low implementation cost. No strong feeling though.
Thanks much for your feedback,
Olivier
More information about the Gcc-patches
mailing list