diff options
author | Quentin Armitage <quentin@armitage.org.uk> | 2010-03-24 12:26:46 -0500 |
---|---|---|
committer | Jeffrey C. Ollie <jeff@ocjtech.us> | 2010-03-24 12:26:46 -0500 |
commit | 4f1aa735c204d08b6022a99b01e97f3cd6c98c75 (patch) | |
tree | 8fc60c8a76a07a0c9e35dd4c96aa3bd17c48ee23 /test/tst-ikstack.c | |
parent | e909440a2abcdf1ed58810a20a7fd6a8f187816f (diff) | |
download | iksemel-4f1aa735c204d08b6022a99b01e97f3cd6c98c75.tar.gz iksemel-4f1aa735c204d08b6022a99b01e97f3cd6c98c75.tar.xz iksemel-4f1aa735c204d08b6022a99b01e97f3cd6c98c75.zip |
Fix alignment on architectures where doubles are 64bit aligned, but pointers are smallerfedora-1.4
The tst-ikstack test fails on architectures where doubles are 64bit
aligned, but pointers are smaller, hence ppc, sparc and arm have the
problems.
The issue is that the ikstack and ikschunk structures are not
necessarily aligned to 64bits, and in fact ikschunk, with 32bit
pointers, is 20 bytes long, and hence not aligned.
The patch forces alignment of the two structures, and more importantly
makes the sizes of the structs multiples of the size of a double.
I have made a couple of other small changes:
i) The ALIGN macro for a pointer that was already aligned was adding
DEFAULT_ALIGNMENT bytes unnecessarily. The amendment also means
that the parameter to the macro is only processed once.
ii) The changing of char data[4] to char data[0] in the ikschunk
struct avoids a wasted allocation of 4 bytes.
Diffstat (limited to 'test/tst-ikstack.c')
0 files changed, 0 insertions, 0 deletions