MCPcopy Create free account
hub / github.com/activeloopai/deeplake / serialize

Method serialize

cpp/icm/bit_vector.hpp:717–728  ·  view source on GitHub ↗

Memory-efficient serialization

Source from the content-addressed store, hash-verified

715
716 // Memory-efficient serialization
717 void serialize(std::vector<uint8_t>& buffer) const
718 {
719 buffer.resize(sizeof(size_t) + blocks_.size() * sizeof(block_type));
720
721 size_t offset = 0;
722 std::memcpy(buffer.data() + offset, &size_, sizeof(size_t));
723 offset += sizeof(size_t);
724
725 if (!blocks_.empty()) {
726 std::memcpy(buffer.data() + offset, blocks_.data(), blocks_.size() * sizeof(block_type));
727 }
728 }
729
730 static bit_vector deserialize(const std::vector<uint8_t>& buffer)
731 {

Callers

nothing calls this directly

Calls 4

resizeMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected