From f94229c430686788a1c7df0502ecc4fc74ea2492 Mon Sep 17 00:00:00 2001 From: Luca Cominardi Date: Fri, 22 Mar 2024 10:14:01 +0100 Subject: [PATCH] Fix alignment and layout for z_owned_reply_t --- include/zenoh_commons.h | 4 ++-- src/get.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 6e45ed3d1..ac121840b 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -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) diff --git a/src/get.rs b/src/get.rs index 07bf0de65..49cd59799 100644 --- a/src/get.rs +++ b/src/get.rs @@ -49,8 +49,8 @@ type ReplyInner = Option; /// /// 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))]