aboutsummaryrefslogtreecommitdiff
path: root/helper/cuckootable.c
diff options
context:
space:
mode:
authorIlias Apalodimas <ilias.apalodimas@linaro.org>2018-01-16 21:09:35 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2018-01-18 22:19:45 +0300
commit5a4502fc6bc53e6503169da3028f456b64811a0b (patch)
tree61a249560d8c4dfa7232676c326088a8f12ec923 /helper/cuckootable.c
parentccb6eb85729ad0657b5c852cb2a6ddb519d60898 (diff)
linux-gen: align: Fix alignment for typedef definitions
* typedef struct { } ODP_ALIGN() test_t; is correct * typedef struct ODP_ALIGN() {} test_t; is correct and preferred from gcc standards * typedef struct {} test_t ODP_ALIGN() discards align Had segfauls on gcc-7 using that Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'helper/cuckootable.c')
-rw-r--r--helper/cuckootable.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/helper/cuckootable.c b/helper/cuckootable.c
index 4707191d7..29298d42d 100644
--- a/helper/cuckootable.c
+++ b/helper/cuckootable.c
@@ -93,12 +93,12 @@ struct cuckoo_table_key_value {
* into a bucket, and each bucket has at most HASH_BUCKET_ENTRIES
* elements.
*/
-struct cuckoo_table_bucket {
+struct ODP_ALIGNED_CACHE cuckoo_table_bucket {
struct cuckoo_table_signatures signatures[HASH_BUCKET_ENTRIES];
/* Includes dummy key index that always contains index 0 */
odp_buffer_t key_buf[HASH_BUCKET_ENTRIES + 1];
uint8_t flag[HASH_BUCKET_ENTRIES];
-} ODP_ALIGNED_CACHE;
+};
/* More efficient access to a map of single ullong */
#define ULLONG_FOR_EACH_1(IDX, MAP) \
@@ -106,7 +106,7 @@ struct cuckoo_table_bucket {
MAP = (MAP & (MAP - 1)))
/** A hash table structure. */
-typedef struct {
+typedef struct ODP_ALIGNED_CACHE {
/**< for check */
uint32_t magicword;
/**< Name of the hash. */
@@ -126,7 +126,7 @@ typedef struct {
/** Table with buckets storing all the hash values and key indexes
to the key table*/
struct cuckoo_table_bucket *buckets;
-} odph_cuckoo_table_impl ODP_ALIGNED_CACHE;
+} odph_cuckoo_table_impl;
/**
* Aligns input parameter to the next power of 2