Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

perf(fix): Use boost vector as underlying storage for the buffer instead of the std::vector #232

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion toolbox/io/Buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <toolbox/Config.h>

#include <boost/asio/buffer.hpp>
#include <boost/container/vector.hpp>

namespace toolbox {
inline namespace io {
Expand Down Expand Up @@ -108,7 +109,7 @@ class TOOLBOX_API Buffer {
std::size_t available() const noexcept { return buf_.size() - wpos_; }

std::size_t rpos_{}, wpos_{};
std::vector<char> buf_;
boost::container::vector<char> buf_;
};

TOOLBOX_API ConstBuffer advance(ConstBuffer buf, std::size_t n) noexcept;
Expand Down
Loading