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

Method deepCopyAndMakeContinuous

bolt/vector/ComplexVector.h:439–456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437 }
438
439 inline void deepCopyAndMakeContinuous(
440 char* dst,
441 int32_t maxDestinationSize,
442 std::vector<int32_t>& offsets) {
443 BOLT_DCHECK(dst && maxDestinationSize >= rowBuffer_->allocatedBytes());
444 BOLT_DCHECK(sanityCheck());
445 offsets.resize(length_);
446 int32_t disOffset = 0;
447 for (auto const& pair : rowToBufferMapping_) {
448 auto bufSize = pair.second.size_;
449 simd::memcpy(dst + disOffset, pair.second.ptr_, bufSize);
450 for (auto i = pair.first; i < pair.first + pair.second.rowCount_; ++i) {
451 offsets[i] = disOffset + (rows_[i] - pair.second.ptr_);
452 }
453 disOffset += bufSize;
454 }
455 return;
456 }
457
458 bool sanityCheck() {
459 int32_t rowCount = 0;

Callers 1

convertMethod · 0.80

Calls 3

memcpyFunction · 0.85
allocatedBytesMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected