[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libunwind-devel] [PATCH 05/57] Align `sos_memory' to MAX_ALIGN
From: |
Tommi Rantala |
Subject: |
[Libunwind-devel] [PATCH 05/57] Align `sos_memory' to MAX_ALIGN |
Date: |
Fri, 21 Sep 2012 14:11:06 +0300 |
We give aligned pointers from the `sos_memory' array, so any non-aligned
bytes are only wasted.
---
include/compiler.h | 2 ++
src/mi/mempool.c | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/compiler.h b/include/compiler.h
index b46d5aa..f519877 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -31,6 +31,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. */
#define COMPILER_H
#ifdef __GNUC__
+# define ALIGNED(x) __attribute__((aligned(x)))
# define UNUSED __attribute__((unused))
# define NORETURN __attribute__((noreturn))
# 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)
# endif
#else
+# define ALIGNED(x)
# define ALWAYS_INLINE
# define UNUSED
# define NORETURN
diff --git a/src/mi/mempool.c b/src/mi/mempool.c
index 66cb099..b04aa63 100644
--- a/src/mi/mempool.c
+++ b/src/mi/mempool.c
@@ -1,6 +1,7 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2002-2003, 2005 Hewlett-Packard Co
Contributed by David Mosberger-Tang <address@hidden>
+ Copyright (C) 2012 Tommi Rantala <address@hidden>
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))
#endif
-static char sos_memory[SOS_MEMORY_SIZE];
+static char sos_memory[SOS_MEMORY_SIZE] ALIGNED(MAX_ALIGN);
static char *sos_memp;
static size_t pg_size;
--
1.7.9.5
- [Libunwind-devel] [PATCH 02/57] Remove unneeded `atomic_ops.h' inclusion in `dwarf.h', (continued)
- [Libunwind-devel] [PATCH 02/57] Remove unneeded `atomic_ops.h' inclusion in `dwarf.h', Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 03/57] Use GCC __BIGGEST_ALIGNMENT__ for sos-pool MAX_ALIGN, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 08/57] Use __sync builtin atomics on all architectures if available, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 01/57] Pull attribute macros from `libunwind_i.h' to new header `compiler.h', Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 07/57] Remove unneeded `cmpxchg_ptr()' from include/libunwind_i.h, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 06/57] Simplify `sos_alloc()' implementation, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 04/57] Workaround non-power-of-two i386 sizeof(long double) in src/mi/mempool.c, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 15/57] HPPA: kludge out unused variable in unw_get_save_loc() stub, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 05/57] Align `sos_memory' to MAX_ALIGN,
Tommi Rantala <=
- [Libunwind-devel] [PATCH 10/57] Apply UNW_ALIGN more in src/mi/mempool.c, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 13/57] PPC: remove unused `PAGE_START' macro from Ginit.c, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 09/57] Invert tdep_init() flag logic, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 14/57] HPPA: properly check dwarf_get() return value in unw_step(), Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 17/57] Clear out `ip' to avoid -Wuninitialized warning in tests/test-coredump-unwind.c, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 20/57] Annotate potentially unused variable in tests/Gtest-bt.c, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 12/57] Remove unused src/x86_64/Lis_signal_frame.c, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 16/57] Default to non-verbose mode in Ltest-cxx-exceptions, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 11/57] IA64: avoid -Wunused-but-set-variable in src/ia64/init.h, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 18/57] Avoid -Wunused-value warning in tests/Gia64-test-stack.c, Tommi Rantala, 2012/09/21