Skip to content

Commit

Permalink
[#532] Update C++ readmes with a more detailed memory layout requirem…
Browse files Browse the repository at this point in the history
…ent description
  • Loading branch information
elfenpiff committed Dec 5, 2024
1 parent 52863d0 commit 8b130f8
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 3 deletions.
14 changes: 14 additions & 0 deletions examples/cxx/domains/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ not receive any data.

## Implementation

> [!CAUTION]
> Every payload you transmit with iceoryx2 must be compatible with shared
> memory. Specifically, it must:
>
> * be self contained, no heap, no pointers to external sources
> * have a uniform memory representation, ensuring that shared structs have the same data layout
> * not use pointers to manage their internal structure
>
> 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.
To achieve this, we create a copy of the global configuration, modify the
setting `config.global.prefix` using the user-provided CLI argument, and then
set up the example accordingly.
Expand Down
14 changes: 14 additions & 0 deletions examples/cxx/event_based_communication/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

## Running The Example

> [!CAUTION]
> Every payload you transmit with iceoryx2 must be compatible with shared
> memory. Specifically, it must:
>
> * be self contained, no heap, no pointers to external sources
> * have a uniform memory representation, ensuring that shared structs have the same data layout
> * not use pointers to manage their internal structure
>
> 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.
This example demonstrates iceoryx2's event multiplexing mechanism in a more
complex setup. The iceoryx2 `Publisher` and `Subscriber` are integrated into
custom `ExamplePublisher` and `ExampleSubscriber` classes, which also
Expand Down
2 changes: 1 addition & 1 deletion examples/cxx/publish_subscribe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ instructions in the [C++ Examples Readme](../README.md).
> memory. Specifically, it must:
>
> * be self contained, no heap, no pointers to external sources
> * have a uniform memory representation -> `#[repr(C)]`
> * have a uniform memory representation, ensuring that shared structs have the same data layout
> * not use pointers to manage their internal structure
>
> Data types like `std::string` or `std::vector` will cause undefined behavior
Expand Down
2 changes: 1 addition & 1 deletion examples/cxx/publish_subscribe_dynamic_data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ allowing users to send samples of arbitrary sizes.
> memory. Specifically, it must:
>
> * be self contained, no heap, no pointers to external sources
> * have a uniform memory representation -> `#[repr(C)]`
> * have a uniform memory representation, ensuring that shared structs have the same data layout
> * not use pointers to manage their internal structure
>
> Data types like `std::string` or `std::vector` will cause undefined behavior
Expand Down
2 changes: 1 addition & 1 deletion examples/cxx/publish_subscribe_with_user_header/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ instructions in the [C++ Examples Readme](../README.md).
> memory. Specifically, it must:
>
> * be self contained, no heap, no pointers to external sources
> * have a uniform memory representation -> `#[repr(C)]`
> * have a uniform memory representation, ensuring that shared structs have the same data layout
> * not use pointers to manage their internal structure
>
> Data types like `std::string` or `std::vector` will cause undefined behavior
Expand Down

0 comments on commit 8b130f8

Please sign in to comment.