Skip to content

Commit

Permalink
refactor: change std::vector to absl::inlinedVector
Browse files Browse the repository at this point in the history
  • Loading branch information
BorysTheDev committed Dec 4, 2024
1 parent 6ee373f commit c1ce60d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/server/journal/streamer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void JournalStreamer::AsyncWrite() {
total_sent_ += cur_buf.mem_size;

const auto v_size = cur_buf.buf.size();
absl::InlinedVector<iovec, 4> v(v_size);
absl::InlinedVector<iovec, 8> v(v_size);

for (size_t i = 0; i < v_size; ++i) {
const auto* uptr = reinterpret_cast<const uint8_t*>(cur_buf.buf[i].data());
Expand Down
2 changes: 1 addition & 1 deletion src/server/journal/streamer.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class JournalStreamer {
public:
struct Buf {
size_t mem_size = 0;
std::vector<std::string> buf; // TODO check inlinedVector option
absl::InlinedVector<std::string, 8> buf;

static constexpr size_t max_buf_size = 1024; // depends on UIO_MAXIOV
};
Expand Down

0 comments on commit c1ce60d

Please sign in to comment.