MCPcopy Create free account
hub / github.com/Icinga/icinga2 / Next

Method Next

lib/otel/otel.cpp:616–631  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

614}
615
616bool AsioProtobufOutStream::Next(void** data, int* size)
617{
618 if (m_Buffered == l_BufferSize) {
619 Flush();
620 }
621 // Prepare a new buffer segment that the Protobuf serializer can write into.
622 // The buffer size is fixed to l_BufferSize, and as seen above, we flush if the previous buffer
623 // segment was fully used (which is always the case on each Next call after the initial one), so
624 // we'll end up reusing the same memory region for each Next call because when we flush, we also
625 // consume the committed data, and that region becomes writable again.
626 auto buf = m_Writer.Prepare(l_BufferSize - m_Buffered);
627 *data = buf.data();
628 *size = static_cast<int>(l_BufferSize);
629 m_Buffered = l_BufferSize;
630 return true;
631}
632
633void AsioProtobufOutStream::BackUp(int count)
634{

Callers

nothing calls this directly

Calls 1

PrepareMethod · 0.80

Tested by

no test coverage detected