Make hmu_tree_node 4 byte aligned to reduce compiler warning (#2268)

This commit is contained in:
YAMAMOTO Takashi 2023-06-07 14:02:55 +09:00 committed by GitHub
parent 6e3c3fe9ec
commit 59e18ca3c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -214,13 +214,16 @@ set_hmu_normal_node_next(hmu_normal_node_t *node, hmu_normal_node_t *next)
#if defined(_MSC_VER)
__pragma(pack(push, 1));
#define __attr_packed
#define __attr_aligned(a)
#elif defined(__GNUC__) || defined(__clang__)
#define __attr_packed __attribute__((packed))
#define __attr_aligned(a) __attribute__((aligned(a)))
#else
#error "packed attribute isn't used to define struct hmu_tree_node"
#endif
#else /* else of UINTPTR_MAX == UINT64_MAX */
#define __attr_packed
#define __attr_aligned(a)
#endif
typedef struct hmu_tree_node {
@ -229,7 +232,7 @@ typedef struct hmu_tree_node {
struct hmu_tree_node *right;
struct hmu_tree_node *parent;
gc_size_t size;
} __attr_packed hmu_tree_node_t;
} __attr_packed __attr_aligned(4) hmu_tree_node_t;
#if UINTPTR_MAX == UINT64_MAX
#if defined(_MSC_VER)