1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-12-01 10:47:38 +01:00

Align `sos_memory' to MAX_ALIGN

We give aligned pointers from the `sos_memory' array, so any non-aligned
bytes are only wasted.
This commit is contained in:
Tommi Rantala 2012-09-19 13:59:41 +03:00
parent c36a14f245
commit 26fc1563fb
2 changed files with 4 additions and 1 deletions

View file

@ -31,6 +31,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#define COMPILER_H #define COMPILER_H
#ifdef __GNUC__ #ifdef __GNUC__
# define ALIGNED(x) __attribute__((aligned(x)))
# define UNUSED __attribute__((unused)) # define UNUSED __attribute__((unused))
# define NORETURN __attribute__((noreturn)) # define NORETURN __attribute__((noreturn))
# define ALIAS(name) __attribute__((alias (#name))) # define ALIAS(name) __attribute__((alias (#name)))
@ -51,6 +52,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
# define unlikely(x) (x) # define unlikely(x) (x)
# endif # endif
#else #else
# define ALIGNED(x)
# define ALWAYS_INLINE # define ALWAYS_INLINE
# define UNUSED # define UNUSED
# define NORETURN # define NORETURN

View file

@ -1,6 +1,7 @@
/* libunwind - a platform-independent unwind library /* libunwind - a platform-independent unwind library
Copyright (C) 2002-2003, 2005 Hewlett-Packard Co Copyright (C) 2002-2003, 2005 Hewlett-Packard Co
Contributed by David Mosberger-Tang <davidm@hpl.hp.com> Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
This file is part of libunwind. This file is part of libunwind.
@ -38,7 +39,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
# define MAX_ALIGN MAX_ALIGN_(sizeof (long double)) # define MAX_ALIGN MAX_ALIGN_(sizeof (long double))
#endif #endif
static char sos_memory[SOS_MEMORY_SIZE]; static char sos_memory[SOS_MEMORY_SIZE] ALIGNED(MAX_ALIGN);
static char *sos_memp; static char *sos_memp;
static size_t pg_size; static size_t pg_size;