From aa3f30ff112a22a2b974705cee25ace88e4cb284 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 2 Mar 2012 21:22:16 -0800 Subject: [PATCH] pool: Use 16-byte alignment on 64-bit architectures. glibc jmp_buf needs 16-byte alignment on ia64. PSPP allocates jmp_buf inside a pool in a few places, so this change should fix many tests on ia64. Found by Debian autobuilder. --- src/libpspp/pool.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/libpspp/pool.c b/src/libpspp/pool.c index 7f3175d477..3150c9056b 100644 --- a/src/libpspp/pool.c +++ b/src/libpspp/pool.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2000, 2010, 2011 Free Software Foundation, Inc. + Copyright (C) 2000, 2010, 2011, 2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -96,10 +96,16 @@ union align void (*fp) (void); long l; double d; + + /* glibc jmp_buf on ia64 requires 16-byte alignment. This ensures it. */ + size_t s[2]; }; /* This should be the alignment size used by malloc(). The size of - the union above is correct, if not optimal, in all known cases. */ + the union above is correct, if not optimal, in all known cases. + + This is normally 8 bytes for 32-bit architectures and 16 bytes for 64-bit + architectures. */ #define ALIGN_SIZE sizeof (union align) /* DISCRETE_BLOCKS may be declared as nonzero to prevent -- 2.30.2