MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / copyFrom

Method copyFrom

src/storage/table/csr_chunked_node_group.cpp:368–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

366}
367
368void InMemChunkedCSRHeader::copyFrom(const InMemChunkedCSRHeader& other) const {
369 DASSERT(offset->getNumValues() == length->getNumValues());
370 DASSERT(other.offset->getNumValues() == other.length->getNumValues());
371 DASSERT(other.offset->getCapacity() == offset->getCapacity());
372 const auto numOtherValues = other.offset->getNumValues();
373 memcpy(offset->getData(), other.offset->getData(), numOtherValues * sizeof(offset_t));
374 memcpy(length->getData(), other.length->getData(), numOtherValues * sizeof(length_t));
375 const auto lastOffsetInOtherHeader = other.getEndCSROffset(numOtherValues);
376 const auto numValues = offset->getNumValues();
377 for (auto i = numOtherValues; i < numValues; i++) {
378 offset->setValue<offset_t>(lastOffsetInOtherHeader, i);
379 length->setValue<length_t>(0, i);
380 }
381}
382
383offset_vec_t InMemChunkedCSRHeader::populateStartCSROffsetsFromLength(bool leaveGaps) const {
384 const auto numNodes = length->getNumValues();

Callers 1

Calls 4

getEndCSROffsetMethod · 0.80
getNumValuesMethod · 0.45
getCapacityMethod · 0.45
getDataMethod · 0.45

Tested by

no test coverage detected