This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] malloc: Correct malloc alignment on 32-bit architectures [BZ #6527]
- From: DJ Delorie <dj at redhat dot com>
- To: fweimer at redhat dot com (Florian Weimer)
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 13 May 2016 17:31:59 -0400
- Subject: Re: [PATCH] malloc: Correct malloc alignment on 32-bit architectures [BZ #6527]
- Authentication-results: sourceware.org; auth=none
- References: <20160513183544 dot 9694240223A68 at oldenburg dot str dot redhat dot com>
fweimer@redhat.com (Florian Weimer) writes:
> -#define MALLOC_STATE_VERSION (0 * 0x100l + 4l) /* major*0x100 + minor */
> +#define MALLOC_STATE_VERSION (0 * 0x100l + 5l) /* major*0x100 + minor */
Do we record a history of what changed for each version bump, in case we
need to go back and somehow support an older one?
> -#ifndef MALLOC_ALIGNMENT
> -# if !SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_16)
> -/* This is the correct definition when there is no past ABI to constrain it.
> -
> - Among configurations with a past ABI constraint, it differs from
> - 2*SIZE_SZ only on powerpc32. For the time being, changing this is
> - causing more compatibility problems due to malloc_get_state and
> - malloc_set_state than will returning blocks not adequately aligned for
> - long double objects under -mlong-double-128. */
> -
> -# define MALLOC_ALIGNMENT (2 *SIZE_SZ < __alignof__ (long double) \
> - ? __alignof__ (long double) : 2 *SIZE_SZ)
> -# else
> -# define MALLOC_ALIGNMENT (2 *SIZE_SZ)
> -# endif
> -#endif
> +#define MALLOC_ALIGNMENT (2 * SIZE_SZ < __alignof__ (long double) \
> + ? __alignof__ (long double) : 2 * SIZE_SZ)
This drops the outer '#ifndef' which I think should remain. The
ChangeLog mentions an override for HPPA.
If there is some platform-specific overrides for ppc32, we should take
those out instead.