| 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); |
no test coverage detected