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

Method DoNext

library/cpp/yt/memory/chunked_output_stream.cpp:85–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85size_t TChunkedOutputStream::DoNext(void** ptr)
86{
87 if (CurrentChunk_.Size() == CurrentChunk_.Capacity()) {
88 if (CurrentChunk_.Capacity() == 0) {
89 CurrentChunk_.Reserve(CurrentReserveSize_);
90 } else {
91 ReserveNewChunk(0);
92 }
93 }
94
95 auto spaceAvailable = CurrentChunk_.Capacity() - CurrentChunk_.Size();
96 YT_ASSERT(spaceAvailable > 0);
97 *ptr = CurrentChunk_.End();
98 CurrentChunk_.Resize(CurrentChunk_.Capacity(), /*initializeStorage*/ false);
99 UpdateCurrentChunkMemoryUsage();
100 return spaceAvailable;
101}
102
103void TChunkedOutputStream::DoUndo(size_t len)
104{

Callers

nothing calls this directly

Calls 5

SizeMethod · 0.45
CapacityMethod · 0.45
ReserveMethod · 0.45
EndMethod · 0.45
ResizeMethod · 0.45

Tested by

no test coverage detected