|
@@ -21,6 +21,8 @@
|
|
* value. */
|
|
* value. */
|
|
#define MEMAREA_ALIGN SIZEOF_VOID_P
|
|
#define MEMAREA_ALIGN SIZEOF_VOID_P
|
|
|
|
|
|
|
|
+
|
|
|
|
+ * pointer. */
|
|
#if MEMAREA_ALIGN == 4
|
|
#if MEMAREA_ALIGN == 4
|
|
#define MEMAREA_ALIGN_MASK 3lu
|
|
#define MEMAREA_ALIGN_MASK 3lu
|
|
#elif MEMAREA_ALIGN == 8
|
|
#elif MEMAREA_ALIGN == 8
|
|
@@ -31,6 +33,7 @@
|
|
|
|
|
|
#if defined(__GNUC__) && defined(FLEXIBLE_ARRAY_MEMBER)
|
|
#if defined(__GNUC__) && defined(FLEXIBLE_ARRAY_MEMBER)
|
|
#define USE_ALIGNED_ATTRIBUTE
|
|
#define USE_ALIGNED_ATTRIBUTE
|
|
|
|
+
|
|
#define U_MEM mem
|
|
#define U_MEM mem
|
|
#else
|
|
#else
|
|
#define U_MEM u.mem
|
|
#define U_MEM u.mem
|
|
@@ -83,12 +86,14 @@ typedef struct memarea_chunk_t {
|
|
* greater than or equal to mem+mem_size, this chunk is
|
|
* greater than or equal to mem+mem_size, this chunk is
|
|
* full. */
|
|
* full. */
|
|
#ifdef USE_ALIGNED_ATTRIBUTE
|
|
#ifdef USE_ALIGNED_ATTRIBUTE
|
|
|
|
+
|
|
char mem[FLEXIBLE_ARRAY_MEMBER] __attribute__((aligned(MEMAREA_ALIGN)));
|
|
char mem[FLEXIBLE_ARRAY_MEMBER] __attribute__((aligned(MEMAREA_ALIGN)));
|
|
#else
|
|
#else
|
|
union {
|
|
union {
|
|
char mem[1];
|
|
char mem[1];
|
|
void *void_for_alignment_;
|
|
void *void_for_alignment_;
|
|
- } u;
|
|
+ } u;
|
|
|
|
+ * doing it right. */
|
|
#endif
|
|
#endif
|
|
} memarea_chunk_t;
|
|
} memarea_chunk_t;
|
|
|
|
|