forked from boostorg/beast
Fix deallocate in multi_buffer
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
Version 262:
|
||||||
|
|
||||||
|
* Fix deallocate in multi_buffer
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
Version 261:
|
Version 261:
|
||||||
|
|
||||||
* Deduplicate `websocket::read_size_hint` definition
|
* Deduplicate `websocket::read_size_hint` definition
|
||||||
|
@@ -977,10 +977,7 @@ consume(size_type n) noexcept
|
|||||||
in_pos_ = 0;
|
in_pos_ = 0;
|
||||||
auto& e = list_.front();
|
auto& e = list_.front();
|
||||||
list_.erase(list_.iterator_to(e));
|
list_.erase(list_.iterator_to(e));
|
||||||
auto const len = sizeof(e) + e.size();
|
destroy(e);
|
||||||
e.~element();
|
|
||||||
alloc_traits::deallocate(a,
|
|
||||||
reinterpret_cast<align_type*>(&e), len);
|
|
||||||
#if BOOST_BEAST_MULTI_BUFFER_DEBUG_CHECK
|
#if BOOST_BEAST_MULTI_BUFFER_DEBUG_CHECK
|
||||||
debug_check();
|
debug_check();
|
||||||
#endif
|
#endif
|
||||||
@@ -1183,7 +1180,8 @@ destroy(element& e)
|
|||||||
{
|
{
|
||||||
auto a = rebind_type{this->get()};
|
auto a = rebind_type{this->get()};
|
||||||
auto const n =
|
auto const n =
|
||||||
(sizeof(element) + e.size() + sizeof(align_type) - 1) /
|
(sizeof(element) + e.size() +
|
||||||
|
sizeof(align_type) - 1) /
|
||||||
sizeof(align_type);
|
sizeof(align_type);
|
||||||
e.~element();
|
e.~element();
|
||||||
alloc_traits::deallocate(a,
|
alloc_traits::deallocate(a,
|
||||||
|
Reference in New Issue
Block a user