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