MCPcopy Create free account
hub / github.com/bytedance/bolt / extendWrite

Method extendWrite

bolt/common/memory/HashStringAllocator.cpp:188–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188void HashStringAllocator::extendWrite(
189 Position position,
190 ByteOutputStream& stream) {
191 auto header = position.header;
192 const auto offset = position.offset();
193 BOLT_CHECK_GE(offset, 0, "Starting extendWrite outside of the current range");
194 BOLT_CHECK_LE(
195 offset,
196 header->usableSize(),
197 "Starting extendWrite outside of the current range");
198
199 if (header->isContinued()) {
200 free(header->nextContinued());
201 header->clearContinued();
202 }
203
204 stream.setRange(
205 ByteRange{
206 reinterpret_cast<uint8_t*>(position.header->begin()),
207 position.header->size(),
208 static_cast<int32_t>(position.position - position.header->begin())},
209 0);
210 currentHeader_ = header;
211 startPosition_ = position;
212}
213
214std::pair<HashStringAllocator::Position, HashStringAllocator::Position>
215HashStringAllocator::finishWrite(

Callers 8

appendMethod · 0.80
appendMethod · 0.80
appendMethod · 0.80
writeMethod · 0.80
writeMethod · 0.80
writeLastNullsMethod · 0.80
appendNonNullMethod · 0.80
TEST_FFunction · 0.80

Calls 8

usableSizeMethod · 0.80
isContinuedMethod · 0.80
nextContinuedMethod · 0.80
clearContinuedMethod · 0.80
offsetMethod · 0.45
setRangeMethod · 0.45
beginMethod · 0.45
sizeMethod · 0.45

Tested by 1

TEST_FFunction · 0.64