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

Method ReserveNewChunk

library/cpp/yt/memory/chunked_output_stream.cpp:55–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55void TChunkedOutputStream::ReserveNewChunk(size_t spaceRequired)
56{
57 YT_ASSERT(CurrentChunk_.Size() == CurrentChunk_.Capacity());
58 FinishedSize_ += CurrentChunk_.Size();
59 FinishedChunks_.push_back(TrackMemory(
60 MemoryUsageTracker_,
61 TSharedRef::FromBlob(std::move(CurrentChunk_))));
62
63 CurrentReserveSize_ = std::min(2 * CurrentReserveSize_, MaxReserveSize_);
64 CurrentChunk_.Reserve(std::max(RoundUpToPage(spaceRequired), CurrentReserveSize_));
65 UpdateCurrentChunkMemoryUsage();
66}
67
68void TChunkedOutputStream::DoWrite(const void* buffer, size_t length)
69{

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected