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

Method appendPartitions

bolt/exec/RowContainer.cpp:1414–1440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1412 if (numPages > 0) {
1413 pool.allocateNonContiguous(numPages, allocation_);
1414 }
1415}
1416
1417void RowPartitions::appendPartitions(folly::Range<const uint8_t*> partitions) {
1418 int32_t toAdd = partitions.size();
1419 int index = 0;
1420 BOLT_CHECK_LE(size_ + toAdd, capacity_);
1421 while (toAdd) {
1422 int32_t run;
1423 int32_t offset;
1424 allocation_.findRun(size_, &run, &offset);
1425 auto runSize = allocation_.runAt(run).numBytes();
1426 auto copySize = std::min<int32_t>(toAdd, runSize - offset);
1427 memcpy(
1428 allocation_.runAt(run).data<uint8_t>() + offset,
1429 &partitions[index],
1430 copySize);
1431 size_ += copySize;
1432 index += copySize;
1433 toAdd -= copySize;
1434 // Zero out to the next multiple of SIMD width for asan/valgring.
1435 if (!toAdd) {
1436 bits::padToAlignment(
1437 allocation_.runAt(run).data<uint8_t>(),
1438 runSize,
1439 offset + copySize,
1440 xsimd::batch<uint8_t>::size);
1441 }
1442 }
1443}

Callers 2

partitionRowsMethod · 0.80
TEST_FFunction · 0.80

Calls 6

memcpyFunction · 0.85
padToAlignmentFunction · 0.85
findRunMethod · 0.80
numBytesMethod · 0.80
runAtMethod · 0.80
sizeMethod · 0.45

Tested by 1

TEST_FFunction · 0.64