diff --git a/CHANGELOG.md b/CHANGELOG.md index 6414e965..bc29d29a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +* Reduce size of multi_buffer. * Upgrade OS on some drone CI jobs. -------------------------------------------------------------------------------- diff --git a/include/boost/beast/core/impl/multi_buffer.hpp b/include/boost/beast/core/impl/multi_buffer.hpp index 51a30fce..77140d4a 100644 --- a/include/boost/beast/core/impl/multi_buffer.hpp +++ b/include/boost/beast/core/impl/multi_buffer.hpp @@ -779,7 +779,7 @@ shrink_to_fit() }; // partial last buffer - if(list_.size() > 1 && out_ != list_.end()) + if(out_ != list_.begin() && out_ != list_.end()) { BOOST_ASSERT(out_ == list_.iterator_to(list_.back())); @@ -815,7 +815,8 @@ shrink_to_fit() } else { - BOOST_ASSERT(list_.size() == 1); + BOOST_ASSERT(out_ == + list_.iterator_to(list_.back())); BOOST_ASSERT(out_pos_ > in_pos_); auto const n = out_pos_ - in_pos_; auto& e = alloc(n); diff --git a/include/boost/beast/core/multi_buffer.hpp b/include/boost/beast/core/multi_buffer.hpp index f77a0af1..1bc5a93d 100644 --- a/include/boost/beast/core/multi_buffer.hpp +++ b/include/boost/beast/core/multi_buffer.hpp @@ -127,7 +127,7 @@ class basic_multi_buffer beast::detail::allocator_traits; using list_type = typename boost::intrusive::make_list< - element, boost::intrusive::constant_time_size>::type; + element, boost::intrusive::constant_time_size>::type; using iter = typename list_type::iterator; @@ -591,4 +591,4 @@ using multi_buffer = basic_multi_buffer>; #include -#endif \ No newline at end of file +#endif diff --git a/include/boost/beast/http/fields.hpp b/include/boost/beast/http/fields.hpp index 3cd0a631..667a97ef 100644 --- a/include/boost/beast/http/fields.hpp +++ b/include/boost/beast/http/fields.hpp @@ -190,7 +190,7 @@ private: using set_t = typename boost::intrusive::make_multiset< element, - boost::intrusive::constant_time_size, + boost::intrusive::constant_time_size, boost::intrusive::compare >::type;