We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f99ecf0 commit 04f176eCopy full SHA for 04f176e
src/cpp/rtps/transport/shared_mem/SharedMemTransport.cpp
@@ -301,11 +301,8 @@ bool SharedMemTransport::init(
301
{
302
return false;
303
}
304
- uint32_t max_allocations = configuration_.segment_size() / configuration_.max_message_size();
305
- if ((configuration_.segment_size() % configuration_.max_message_size()) != 0)
306
- {
307
- ++max_allocations;
308
- }
+ uint32_t mean_message_size = configuration_.max_message_size() / 2;
+ uint32_t max_allocations = configuration_.segment_size() / mean_message_size;
309
if (configuration_.port_queue_capacity() > max_allocations)
310
311
max_allocations = configuration_.port_queue_capacity();
0 commit comments