Skip to content

Commit 04f176e

Browse files
committed
Refs #22841. Consider a mean message size of half the max message size.
Signed-off-by: Miguel Company <[email protected]>
1 parent f99ecf0 commit 04f176e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/cpp/rtps/transport/shared_mem/SharedMemTransport.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,8 @@ bool SharedMemTransport::init(
301301
{
302302
return false;
303303
}
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-
}
304+
uint32_t mean_message_size = configuration_.max_message_size() / 2;
305+
uint32_t max_allocations = configuration_.segment_size() / mean_message_size;
309306
if (configuration_.port_queue_capacity() > max_allocations)
310307
{
311308
max_allocations = configuration_.port_queue_capacity();

0 commit comments

Comments
 (0)