Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowhatter committed Nov 20, 2024
1 parent 50e4b69 commit 74ed769
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions rmw_zenoh_cpp/src/detail/rmw_context_impl_s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,10 @@ class rmw_context_impl_s::Data final
if (rmw_zenoh_cpp::zenoh_shm_enabled()) {
RMW_ZENOH_LOG_DEBUG_NAMED("rmw_zenoh_cpp", "SHM is enabled");

shm_ = std::make_optional(rmw_zenoh_cpp::ShmContext(
rmw_zenoh_cpp::zenoh_shm_alloc_size(),
rmw_zenoh_cpp::zenoh_shm_message_size_threshold()
shm_ = std::make_optional(
rmw_zenoh_cpp::ShmContext(
rmw_zenoh_cpp::zenoh_shm_alloc_size(),
rmw_zenoh_cpp::zenoh_shm_message_size_threshold()
));
} else {
RMW_ZENOH_LOG_DEBUG_NAMED("rmw_zenoh_cpp", "SHM is disabled");
Expand Down
8 changes: 4 additions & 4 deletions rmw_zenoh_cpp/src/detail/shm_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ namespace rmw_zenoh_cpp
ShmContext::ShmContext(size_t alloc_size, size_t msgsize_threshold)
:msgsize_threshold(msgsize_threshold)
{
// Create Layout for provider's memory
// Provider's alignment will be 1 byte as we are going to make only 1-byte aligned allocations
// TODO(yellowhatter): use zenoh_shm_message_size_threshold as base for alignment
// Create Layout for provider's memory
// Provider's alignment will be 1 byte as we are going to make only 1-byte aligned allocations
// TODO(yellowhatter): use zenoh_shm_message_size_threshold as base for alignment
z_alloc_alignment_t alignment = {0};
z_owned_memory_layout_t layout;
if (z_memory_layout_new(&layout, alloc_size, alignment) != Z_OK) {
throw std::runtime_error("Unable to create a Layout for SHM provider.");
}
// Create SHM provider
// Create SHM provider
const auto provider_creation_result =
z_posix_shm_provider_new(&shm_provider, z_loan(layout));
z_drop(z_move(layout));
Expand Down

0 comments on commit 74ed769

Please sign in to comment.