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

Method PrepareWrite

library/cpp/threading/chunk_queue/queue.h:171–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169
170 protected:
171 T* PrepareWrite() {
172 TChunk* chunk = Writer.Chunk;
173 Y_ASSERT(chunk && !chunk->Next);
174
175 if (chunk->Count != TChunk::MaxCount) {
176 return chunk->GetPtr(chunk->Count);
177 }
178
179 chunk = new TChunk();
180 AtomicSet(Writer.Chunk->Next, chunk);
181 Writer.Chunk = chunk;
182 return chunk->GetPtr(0);
183 }
184
185 void CompleteWrite() {
186 AtomicSet(Writer.Chunk->Count, Writer.Chunk->Count + 1);

Callers 1

TryEnqueueMethod · 0.80

Calls 2

AtomicSetFunction · 0.50
GetPtrMethod · 0.45

Tested by

no test coverage detected