[PATCH] Implement new hook for max_align_t_align

Jakub Jelinek jakub@redhat.com
Tue Oct 11 20:57:00 GMT 2016


On Tue, Oct 11, 2016 at 04:54:56PM -0400, John David Anglin wrote:
> But the check isn't directly about malloc.  It's between the alignment for
> max_align_t
> and the alignment that the type wants.  Joseph indicated that max_align_t
> should have an
> alignment as large as the POSIX types (e.g., pthread_mutex_t).  So, I think
> setting it to 16
> when pthread_mutex_t wants an alignment of 16 is correct.

But precondition of bumping max_align_t to 16 is IMHO that malloc actually
provides that alignment.  If that is not the case, then I think you should
just drop the alignment attribute from pthread_mutex_t etc. and deal with
the ABI change.

	Jakub



More information about the Gcc-patches mailing list