MCPcopy Create free account
hub / github.com/cuberite/cuberite / GetFreeSpace

Method GetFreeSpace

src/ByteBuffer.cpp:220–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218
219
220size_t cByteBuffer::GetFreeSpace(void) const
221{
222 CHECK_THREAD;
223 CheckValid();
224 if (m_WritePos >= m_DataStart)
225 {
226 // Wrap around the buffer end:
227 ASSERT(m_BufferSize >= m_WritePos);
228 ASSERT((m_BufferSize - m_WritePos + m_DataStart) >= 1);
229 return m_BufferSize - m_WritePos + m_DataStart - 1;
230 }
231 // Single free space partition:
232 ASSERT(m_BufferSize >= m_WritePos);
233 ASSERT(m_BufferSize - m_WritePos >= 1);
234 return m_DataStart - m_WritePos - 1;
235}
236
237
238

Callers 2

TestWrapMethod · 0.80
SendDataMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestWrapMethod · 0.64