Skip to content

Commit

Permalink
[#525] Fix 32-bit int size bug
Browse files Browse the repository at this point in the history
  • Loading branch information
elfenpiff committed Nov 26, 2024
1 parent 1bf0bfd commit f656be3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ pub mod details {

self.data_ptr.init(fail!(from self, when allocator
.allocate( Layout::from_size_align_unchecked(
std::mem::size_of::<usize>() * (self.capacity + 1),
std::mem::align_of::<usize>())),
std::mem::size_of::<u64>() * (self.capacity + 1),
std::mem::align_of::<u64>())),
"Failed to initialize since the allocation of the data memory failed."));

for i in 0..self.capacity + 1 {
Expand Down Expand Up @@ -206,7 +206,7 @@ pub mod details {
/// Returns the amount of memory required to create a [`SafelyOverflowingIndexQueue`] with
/// the provided capacity.
pub const fn const_memory_size(capacity: usize) -> usize {
unaligned_mem_size::<UnsafeCell<usize>>(capacity + 1)
unaligned_mem_size::<UnsafeCell<u64>>(capacity + 1)
}

fn at(&self, position: usize) -> *mut u64 {
Expand Down
2 changes: 1 addition & 1 deletion iceoryx2-cal/tests/zero_copy_connection_trait_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ mod zero_copy_connection {
))
.unwrap();

assert_that!(sut_sender.reclaim().err(), eq Some(ZeroCopyReclaimError:ReceiverReturnedCorruptedPointerOffset));
assert_that!(sut_sender.reclaim().err(), eq Some(ZeroCopyReclaimError::ReceiverReturnedCorruptedPointerOffset));
}

#[test]
Expand Down

0 comments on commit f656be3

Please sign in to comment.