Don't over-allocate in http::basic_fields

This commit is contained in:
Vinnie Falco committed 2019-07-01 12:49:03 -07:00
1 parent 5f0939e771
commit d5cd3e829b
3 files changed
+4 -3

No files matched your search

+1 -1
View File
@@ -196,7 +196,7 @@ private:
using rebind_type = typename
beast::detail::allocator_traits<Allocator>::
template rebind_alloc<element>;
template rebind_alloc<align_type>;
using alloc_traits =
beast::detail::allocator_traits<rebind_type>;
+2 -2
View File
@@ -990,8 +990,8 @@ delete_element(element& e)
(sizeof(element) + e.off_ + e.len_ + 2 + sizeof(align_type) - 1) /
sizeof(align_type);
e.~element();
alloc_traits::deallocate(a, &e, n);
//reinterpret_cast<align_type*>(&e), n);
alloc_traits::deallocate(a,
reinterpret_cast<align_type*>(&e), n);
}
template<class Allocator>