Skip to content

Commit

Permalink
[#532] Add debug_assert and fix C++ docu
Browse files Browse the repository at this point in the history
  • Loading branch information
elfenpiff committed Dec 5, 2024
1 parent b150b78 commit 52863d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/cxx/publish_subscribe_dynamic_data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ allowing users to send samples of arbitrary sizes.
> * have a uniform memory representation -> `#[repr(C)]`
> * not use pointers to manage their internal structure
>
> Data types like `String` or `Vec` will cause undefined behavior and may
> result in segmentation faults. We provide alternative data types that are
> compatible with shared memory. See the
> Data types like `std::string` or `std::vector` will cause undefined behavior
> and may result in segmentation faults. We provide alternative data types
> that are compatible with shared memory. See the
> [complex data type example](../complex_data_types) for guidance on how to
> use them.
Expand Down
1 change: 1 addition & 0 deletions iceoryx2/src/port/publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ impl SegmentState {
}

fn sample_index(&self, distance_to_chunk: usize) -> usize {
debug_assert!(distance_to_chunk % self.payload_size() == 0);
distance_to_chunk / self.payload_size()
}

Expand Down

0 comments on commit 52863d0

Please sign in to comment.