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

Method Preallocate

library/cpp/yt/memory/chunked_output_stream.cpp:110–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110char* TChunkedOutputStream::Preallocate(size_t size)
111{
112 size_t available = CurrentChunk_.Capacity() - CurrentChunk_.Size();
113 if (available < size) {
114 FinishedSize_ += CurrentChunk_.Size();
115 FinishedChunks_.push_back(TrackMemory(
116 MemoryUsageTracker_,
117 TSharedRef::FromBlob(std::move(CurrentChunk_))));
118
119 CurrentReserveSize_ = std::min(2 * CurrentReserveSize_, MaxReserveSize_);
120
121 CurrentChunk_.Reserve(std::max(RoundUpToPage(size), CurrentReserveSize_));
122 }
123 UpdateCurrentChunkMemoryUsage();
124 return CurrentChunk_.End();
125}
126
127void TChunkedOutputStream::Advance(size_t size)
128{

Callers

nothing calls this directly

Calls 10

TrackMemoryFunction · 0.85
RoundUpToPageFunction · 0.85
moveFunction · 0.50
minFunction · 0.50
maxFunction · 0.50
CapacityMethod · 0.45
SizeMethod · 0.45
push_backMethod · 0.45
ReserveMethod · 0.45
EndMethod · 0.45

Tested by

no test coverage detected