Skip to content

Commit

Permalink
Restrict Vector Reserve Count in RtpsUdpDataLink
Browse files Browse the repository at this point in the history
If the number of remotes and `meta_submessages` is large, then this will
waste a lot of space.
  • Loading branch information
iguessthislldo committed Aug 20, 2024
1 parent 8b2d38e commit f69bb26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dds/DCPS/transport/rtps_udp/RtpsUdpDataLink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2436,6 +2436,7 @@ RtpsUdpDataLink::build_meta_submessage_map(MetaSubmessageVec& meta_submessages,
size_t cache_misses = 0;
size_t addrset_min_size = std::numeric_limits<size_t>::max();
size_t addrset_max_size = 0;
const size_t reserve_count = std::min(meta_submessages.size(), 64);

Check failure on line 2439 in dds/DCPS/transport/rtps_udp/RtpsUdpDataLink.cpp

View workflow job for this annotation

GitHub Actions / u22_no_features

no matching function for call to ‘min(std::vector<OpenDDS::DCPS::MetaSubmessage>::size_type, int)’

Check failure on line 2439 in dds/DCPS/transport/rtps_udp/RtpsUdpDataLink.cpp

View workflow job for this annotation

GitHub Actions / u22_stat

no matching function for call to ‘min(std::vector<OpenDDS::DCPS::MetaSubmessage>::size_type, int)’

Check failure on line 2439 in dds/DCPS/transport/rtps_udp/RtpsUdpDataLink.cpp

View workflow job for this annotation

GitHub Actions / u22

no matching function for call to ‘min(std::vector<OpenDDS::DCPS::MetaSubmessage>::size_type, int)’

Check failure on line 2439 in dds/DCPS/transport/rtps_udp/RtpsUdpDataLink.cpp

View workflow job for this annotation

GitHub Actions / u22_android29

no matching function for call to 'min'

Check failure on line 2439 in dds/DCPS/transport/rtps_udp/RtpsUdpDataLink.cpp

View workflow job for this annotation

GitHub Actions / build_u20_gcc9_d0w1_cpp03

no matching function for call to ‘min(std::vector<OpenDDS::DCPS::MetaSubmessage>::size_type, int)’

Check failure on line 2439 in dds/DCPS/transport/rtps_udp/RtpsUdpDataLink.cpp

View workflow job for this annotation

GitHub Actions / w22_stat

'std::min': no matching overloaded function found [D:\a\OpenDDS\OpenDDS\OpenDDS\build\dds\DCPS\transport\rtps_udp\OpenDDS_Rtps_Udp.vcxproj]

Check failure on line 2439 in dds/DCPS/transport/rtps_udp/RtpsUdpDataLink.cpp

View workflow job for this annotation

GitHub Actions / w22_stat

'reserve_count': const object must be initialized [D:\a\OpenDDS\OpenDDS\OpenDDS\build\dds\DCPS\transport\rtps_udp\OpenDDS_Rtps_Udp.vcxproj]

Check failure on line 2439 in dds/DCPS/transport/rtps_udp/RtpsUdpDataLink.cpp

View workflow job for this annotation

GitHub Actions / build_u20_clang12_i0w1_sec

no matching function for call to 'min'

Check failure on line 2439 in dds/DCPS/transport/rtps_udp/RtpsUdpDataLink.cpp

View workflow job for this annotation

GitHub Actions / w22_rel

'std::min': no matching overloaded function found [D:\a\OpenDDS\OpenDDS\OpenDDS\build\dds\DCPS\transport\rtps_udp\OpenDDS_Rtps_Udp.vcxproj]

Check failure on line 2439 in dds/DCPS/transport/rtps_udp/RtpsUdpDataLink.cpp

View workflow job for this annotation

GitHub Actions / w22_rel

'reserve_count': const object must be initialized [D:\a\OpenDDS\OpenDDS\OpenDDS\build\dds\DCPS\transport\rtps_udp\OpenDDS_Rtps_Udp.vcxproj]

Check failure on line 2439 in dds/DCPS/transport/rtps_udp/RtpsUdpDataLink.cpp

View workflow job for this annotation

GitHub Actions / w22

'std::min': no matching overloaded function found [D:\a\OpenDDS\OpenDDS\OpenDDS\build\dds\DCPS\transport\rtps_udp\OpenDDS_Rtps_Udp.vcxproj]

Check failure on line 2439 in dds/DCPS/transport/rtps_udp/RtpsUdpDataLink.cpp

View workflow job for this annotation

GitHub Actions / w22

'reserve_count': const object must be initialized [D:\a\OpenDDS\OpenDDS\OpenDDS\build\dds\DCPS\transport\rtps_udp\OpenDDS_Rtps_Udp.vcxproj]

Check failure on line 2439 in dds/DCPS/transport/rtps_udp/RtpsUdpDataLink.cpp

View workflow job for this annotation

GitHub Actions / w22_rel_stat

'std::min': no matching overloaded function found [D:\a\OpenDDS\OpenDDS\OpenDDS\build\dds\DCPS\transport\rtps_udp\OpenDDS_Rtps_Udp.vcxproj]

Check failure on line 2439 in dds/DCPS/transport/rtps_udp/RtpsUdpDataLink.cpp

View workflow job for this annotation

GitHub Actions / w22_rel_stat

'reserve_count': const object must be initialized [D:\a\OpenDDS\OpenDDS\OpenDDS\build\dds\DCPS\transport\rtps_udp\OpenDDS_Rtps_Udp.vcxproj]

Check failure on line 2439 in dds/DCPS/transport/rtps_udp/RtpsUdpDataLink.cpp

View workflow job for this annotation

GitHub Actions / build_u20_gcc8_i0_js0_j

no matching function for call to ‘min(std::vector<OpenDDS::DCPS::MetaSubmessage>::size_type, int)’

Check failure on line 2439 in dds/DCPS/transport/rtps_udp/RtpsUdpDataLink.cpp

View workflow job for this annotation

GitHub Actions / build_u22_d0i0v1_sec_js0_FM-08

no matching function for call to ‘min(std::vector<OPENDDS_3_30_0::OpenDDS::DCPS::MetaSubmessage>::size_type, int)’

Check failure on line 2439 in dds/DCPS/transport/rtps_udp/RtpsUdpDataLink.cpp

View workflow job for this annotation

GitHub Actions / build_u22_o1d0v1_xer0_j11

no matching function for call to ‘min(std::vector<OPENDDS_3_30_0::OpenDDS::DCPS::MetaSubmessage>::size_type, int)’

BundlingCache::ScopedAccess global_access(bundling_cache_);
const MonotonicTimePoint now = MonotonicTimePoint::now();
Expand Down Expand Up @@ -2487,11 +2488,11 @@ RtpsUdpDataLink::build_meta_submessage_map(MetaSubmessageVec& meta_submessages,
DestMetaSubmessageMap& dest_map = addr_map[AddressCacheEntryProxy(const_entry.rch_)];
if (std::memcmp(&(it->dst_guid_.guidPrefix), &GUIDPREFIX_UNKNOWN, sizeof(GuidPrefix_t)) != 0) {
MetaSubmessageIterVec& vec = dest_map[make_unknown_guid(it->dst_guid_.guidPrefix)];
vec.reserve(meta_submessages.size());
vec.reserve(reserve_count);
vec.push_back(it);
} else {
MetaSubmessageIterVec& vec = dest_map[GUID_UNKNOWN];
vec.reserve(meta_submessages.size());
vec.reserve(reserve_count);
vec.push_back(it);
}
}
Expand Down

0 comments on commit f69bb26

Please sign in to comment.