Skip to content

Commit

Permalink
Merge pull request #55 from Flow-IPC/boost-1.84
Browse files Browse the repository at this point in the history
Boost upgrade 1.83->1.84.
  • Loading branch information
ygoldfeld authored Feb 14, 2024
2 parents a5f22bc + f291c1f commit 4c6a57a
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def build(self):

def requirements(self):
if self.options.build:
self.requires("boost/1.83.0")
self.requires("boost/1.84.0")
self.requires("fmt/10.0.0")

def build_requirements(self):
Expand Down
1 change: 1 addition & 0 deletions src/flow/async/detail/task_qing_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "flow/async/detail/task_qing_thread.hpp"
#include "flow/log/config.hpp"
#include <boost/asio.hpp>
#include <boost/move/make_unique.hpp>
#include <string>
#include <exception>
#include <cstdlib>
Expand Down
1 change: 1 addition & 0 deletions src/flow/cfg/cfg_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "flow/cfg/option_set.hpp"
#include "flow/util/util.hpp"
#include "flow/util/shared_ptr_alias_holder.hpp"
#include <boost/array.hpp>

namespace flow::cfg
{
Expand Down
1 change: 1 addition & 0 deletions src/flow/log/async_file_logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "flow/log/async_file_logger.hpp"
#include "flow/log/detail/serial_file_logger.hpp"
#include "flow/error/error.hpp"
#include <boost/move/make_unique.hpp>
#include <algorithm>
#include <memory>
#include <utility>
Expand Down
1 change: 1 addition & 0 deletions src/flow/log/detail/thread_lcl_str_appender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

/// @file
#include "flow/log/detail/thread_lcl_str_appender.hpp"
#include <boost/move/make_unique.hpp>

namespace flow::log
{
Expand Down
10 changes: 7 additions & 3 deletions src/flow/log/ostream_log_msg_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@ Ostream_log_msg_writer::Ostream_log_msg_writer(const Config& config, std::ostrea
}
} // Ostream_log_msg_writer::Ostream_log_msg_writer()

/* This is here just so we could document this cleanly in .hpp. As promised m_clean_os_state dtor will auto-restore
* any formatting changes we'd made to m_os throughout. */
Ostream_log_msg_writer::~Ostream_log_msg_writer() = default;
/* As promised m_clean_os_state dtor will auto-restore any formatting changes we'd made to m_os throughout.
* This class uses boost::basic_ios_all_saver() (aka Ostream_state) which is explicitly marked as noexcept(false)
* in boost 1.84. The fix is to override the noexcept(false) specification to noexcept(true) in this class
* and let it call std::terminate in case it throws (IMO it shouldn't throw, but I didn't study it to the depth). */
Ostream_log_msg_writer::~Ostream_log_msg_writer() noexcept
{
}

void Ostream_log_msg_writer::log(const Msg_metadata& metadata, util::String_view msg)
{
Expand Down
4 changes: 2 additions & 2 deletions src/flow/log/ostream_log_msg_writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ class Ostream_log_msg_writer :
*/
explicit Ostream_log_msg_writer(const Config& config, std::ostream& os);

/// Fairly boring destructor. Restores formatting state of `os` to how it was before entry to constructor.
~Ostream_log_msg_writer();
/// Restores formatting state of `os` to how it was before entry to constructor.
~Ostream_log_msg_writer() noexcept;

// Methods.

Expand Down
10 changes: 2 additions & 8 deletions src/flow/net_flow/peer_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2063,8 +2063,6 @@ void Node::handle_accumulated_acks(const Socket_id& socket_id, Peer_socket::Ptr
using std::min;
using std::vector;
using boost::tuple;
using boost::make_tuple;
using boost::tie;
using boost::unordered_set;
using boost::chrono::round;
using boost::chrono::milliseconds;
Expand Down Expand Up @@ -2330,7 +2328,7 @@ void Node::handle_accumulated_acks(const Socket_id& socket_id, Peer_socket::Ptr
* to save it. (@todo Performance?) */
const size_t bytes_acked = flying_pkt->m_size;
const size_t cwnd_bytes = sent_when->m_sent_cwnd_bytes;
clean_acked_packet_events.push_back(make_tuple(round_trip_time, bytes_acked, cwnd_bytes));
clean_acked_packet_events.emplace_back(round_trip_time, bytes_acked, cwnd_bytes);

// Maintain invariant. Packet acknowledged, so remove from In-flight packet list and related structures.
snd_flying_pkts_erase_one(sock, flying_pkt_it);
Expand Down Expand Up @@ -2437,12 +2435,8 @@ void Node::handle_accumulated_acks(const Socket_id& socket_id, Peer_socket::Ptr
assert(!clean_acked_packet_events.empty());

// Report individual (clean) acks to congestion control.
for (const auto& clean_acked_packet : clean_acked_packet_events)
for (const auto& [rtt, bytes, cwnd_bytes] : clean_acked_packet_events)
{
Fine_duration rtt;
size_t bytes, cwnd_bytes;
tie(rtt, bytes, cwnd_bytes) = clean_acked_packet;

FLOW_LOG_TRACE("cong_ctl [" << sock << "] update: clean individual acknowledgment: "
"[" << sock->bytes_blocks_str(bytes) << "] with RTT [" << round<milliseconds>(rtt) <<
"] and sent_cwnd_bytes [" << cwnd_bytes << "].");
Expand Down
1 change: 1 addition & 0 deletions src/flow/util/basic_blob.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "flow/util/blob_fwd.hpp"
#include "flow/log/log.hpp"
#include <boost/interprocess/smart_ptr/shared_ptr.hpp>
#include <boost/move/make_unique.hpp>
#include <optional>
#include <limits>

Expand Down
2 changes: 1 addition & 1 deletion tools/cmake/FlowLikeLib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ list(APPEND CMAKE_MESSAGE_INDENT "- ")
# - defined BOOST_LIBS but blank => do ensure Boost of the proper version is available/configured for headers;
# - defined BOOST_LIBS and not blank => additionally ensure those Boost libs are available/configured for use.
if(DEFINED BOOST_LIBS)
set(BOOST_VER 1.83) # Current as of Oct 2023.
set(BOOST_VER 1.84) # Current as of Feb 2024.

message(CHECK_START "(Finding dep: Boost-${BOOST_VER}: headers plus libs [${BOOST_LIBS}].)")
list(APPEND CMAKE_MESSAGE_INDENT "- ")
Expand Down

0 comments on commit 4c6a57a

Please sign in to comment.