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
改成下面的方式,在运行过程中添加有效性判断 virtual int read(T *data, unsigned int size) { if (size > m_maxBufferSize) { size = m_maxBufferSize; }
unsigned int readDataSize = 0; while ((!isEmpty()) && (readDataSize < size)) { data[readDataSize] = m_buffer[m_head & (m_maxBufferSize - 1)]; ++readDataSize; m_head = (m_head + 1) & m_maxMirrorBufferIndex; } return readDataSize; }
The text was updated successfully, but these errors were encountered:
目前的读取方式会遇到什么问题吗
Sorry, something went wrong.
No branches or pull requests
改成下面的方式,在运行过程中添加有效性判断
virtual int read(T *data, unsigned int size)
{
if (size > m_maxBufferSize)
{
size = m_maxBufferSize;
}
The text was updated successfully, but these errors were encountered: