We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
上图中的
void makeSpace(size_t len) { //kCheapPrepend为保留的空间 if (writableBytes() + prependableBytes() < len + kCheapPrepend) { // FIXME: move readable data m_buffer.resize(m_writerIndex + len); } else { // move readable data to the front, make space inside buffer //assert(kCheapPrepend < readerIndex_); if (kCheapPrepend >= m_readerIndex) return; size_t readable = readableBytes(); std::copy(begin() + m_readerIndex, begin() + m_writerIndex, begin() + kCheapPrepend); m_readerIndex = kCheapPrepend; m_writerIndex = m_readerIndex + readable; } }
应该在收包的过程中,这种copy数据应该是很常发生的
The text was updated successfully, but these errors were encountered:
No branches or pull requests
上图中的
应该在收包的过程中,这种copy数据应该是很常发生的
The text was updated successfully, but these errors were encountered: