MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / Unserialize_impl

Function Unserialize_impl

src/serialize.h:653–666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

651
652template<typename Stream, unsigned int N, typename T>
653void Unserialize_impl(Stream& is, prevector<N, T>& v, const unsigned char&)
654{
655 // Limit size per read so bogus size value won't cause out of memory
656 v.clear();
657 unsigned int nSize = ReadCompactSize(is);
658 unsigned int i = 0;
659 while (i < nSize)
660 {
661 unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));
662 v.resize(i + blk);
663 is.read((char*)&v[i], blk * sizeof(T));
664 i += blk;
665 }
666}
667
668template<typename Stream, unsigned int N, typename T, typename V>
669void Unserialize_impl(Stream& is, prevector<N, T>& v, const V&)

Callers 1

UnserializeFunction · 0.85

Calls 5

ReadCompactSizeFunction · 0.85
UnserializeFunction · 0.85
clearMethod · 0.45
resizeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected