Skip to content

Commit

Permalink
Fix alignment and layout for z_owned_reply_t
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets committed Mar 22, 2024
1 parent bd0fe98 commit f94229c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/zenoh_commons.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ typedef struct z_owned_closure_query_t {
* To check if `val` is still valid, you may use `z_X_check(&val)` (or `z_check(val)` if your compiler supports `_Generic`), which will return `true` if `val` is valid.
*/
#if defined(TARGET_ARCH_X86_64)
typedef struct ALIGN(8) z_owned_reply_t {
uint64_t _0[28];
typedef struct ALIGN(16) z_owned_reply_t {
uint64_t _0[30];
} z_owned_reply_t;
#endif
#if defined(TARGET_ARCH_AARCH64)
Expand Down
4 changes: 2 additions & 2 deletions src/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ type ReplyInner = Option<Reply>;
///
/// To check if `val` is still valid, you may use `z_X_check(&val)` (or `z_check(val)` if your compiler supports `_Generic`), which will return `true` if `val` is valid.
#[cfg(target_arch = "x86_64")]
#[repr(C, align(8))]
pub struct z_owned_reply_t([u64; 28]);
#[repr(C, align(16))]
pub struct z_owned_reply_t([u64; 30]);

#[cfg(target_arch = "aarch64")]
#[repr(C, align(16))]
Expand Down

0 comments on commit f94229c

Please sign in to comment.