aboutsummaryrefslogtreecommitdiff
path: root/malloc
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2012-05-21 11:13:10 -0700
committerRoland McGrath <roland@hack.frob.com>2012-05-21 11:13:10 -0700
commitcbc00a03986c5890f0a9d2c7cdac26b7606fe98c (patch)
tree864ed2965fbee17dabb6483a0359921fed969cf0 /malloc
parent478143fa1706a0212366dfa4d9bcf3d8334ca131 (diff)
downloadglibc-cbc00a03986c5890f0a9d2c7cdac26b7606fe98c.zip
glibc-cbc00a03986c5890f0a9d2c7cdac26b7606fe98c.tar.gz
glibc-cbc00a03986c5890f0a9d2c7cdac26b7606fe98c.tar.bz2
Set MALLOC_ALIGNMENT to at least __alignof__ (long double) for new ABIs.
Diffstat (limited to 'malloc')
-rw-r--r--malloc/malloc.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c
index abe3872..c216d26 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -337,16 +337,20 @@ __malloc_assert (const char *assertion, const char *file, unsigned int line,
#ifndef MALLOC_ALIGNMENT
-/* XXX This is the correct definition. 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/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)
-*/
-#define MALLOC_ALIGNMENT (2 * SIZE_SZ)
+# 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
/* The corresponding bit mask value */