mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-22 07:37:38 +01:00
Use GCC __BIGGEST_ALIGNMENT__ for sos-pool MAX_ALIGN
Use the __BIGGEST_ALIGNMENT__ macro provided by GCC for sos_alloc() allocation alignment. The macro gives ``the largest alignment ever used for any data type on the target machine you are compiling for.'' __BIGGEST_ALIGNMENT__ also has some other nice properties, e.g. it is power-of-two on all architectures (note that on i386, sizeof(long double) = 12), and on some architectures (e.g. SuperH) the alignment requirement can be lower than sizeof(long double).
This commit is contained in:
parent
0aa60f4f15
commit
e6edad069c
1 changed files with 8 additions and 1 deletions
|
@ -25,7 +25,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
|
|
||||||
#include "libunwind_i.h"
|
#include "libunwind_i.h"
|
||||||
|
|
||||||
#define MAX_ALIGN (sizeof (long double))
|
/* From GCC docs: ``Gcc also provides a target specific macro
|
||||||
|
* __BIGGEST_ALIGNMENT__, which is the largest alignment ever used for any data
|
||||||
|
* type on the target machine you are compiling for.'' */
|
||||||
|
#ifdef __BIGGEST_ALIGNMENT__
|
||||||
|
# define MAX_ALIGN __BIGGEST_ALIGNMENT__
|
||||||
|
#else
|
||||||
|
# define MAX_ALIGN (sizeof (long double))
|
||||||
|
#endif
|
||||||
|
|
||||||
static char sos_memory[SOS_MEMORY_SIZE];
|
static char sos_memory[SOS_MEMORY_SIZE];
|
||||||
static char *sos_memp;
|
static char *sos_memp;
|
||||||
|
|
Loading…
Reference in a new issue