MCPcopy Create free account
hub / github.com/catboost/catboost / DoWrite

Method DoWrite

library/cpp/yt/memory/chunked_output_stream.cpp:68–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void TChunkedOutputStream::DoWrite(const void* buffer, size_t length)
69{
70 if (CurrentChunk_.Capacity() == 0) {
71 CurrentChunk_.Reserve(CurrentReserveSize_);
72 }
73
74 auto spaceAvailable = std::min(length, CurrentChunk_.Capacity() - CurrentChunk_.Size());
75 CurrentChunk_.Append(buffer, spaceAvailable);
76
77 auto spaceRequired = length - spaceAvailable;
78 if (spaceRequired > 0) {
79 ReserveNewChunk(spaceRequired);
80 CurrentChunk_.Append(static_cast<const char*>(buffer) + spaceAvailable, spaceRequired);
81 }
82 UpdateCurrentChunkMemoryUsage();
83}
84
85size_t TChunkedOutputStream::DoNext(void** ptr)
86{

Callers

nothing calls this directly

Calls 5

minFunction · 0.50
CapacityMethod · 0.45
ReserveMethod · 0.45
SizeMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected