pre allocate async q memory

This commit is contained in:
gabime
2018-07-04 00:38:23 +03:00
parent 92e2cef67f
commit b4349e4226
4 changed files with 79 additions and 20 deletions

View File

@@ -24,9 +24,10 @@ inline void append_c_str(const char *c_str, fmt::memory_buffer &dest)
}
}
inline void append_buf(const fmt::memory_buffer &buf, fmt::memory_buffer &dest)
template<size_t N1, size_t N2>
inline void append_buf(const fmt::basic_memory_buffer<char, N1> &buf, fmt::basic_memory_buffer<char, N2> &dest)
{
const char *buf_ptr = buf.data();
auto *buf_ptr = buf.data();
dest.append(buf_ptr, buf_ptr + buf.size());
}