MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / segmentTemp

Method segmentTemp

GPRS/ByteVector.cpp:142–149  ·  view source on GitHub ↗

This returns a segment that does not share ownership of the original memory, so when the original is deleted, this is destroyed also, and without warning. Very easy to insert bugs in your code, which is why it is called segmentTemp to indicate that it is a ByteVector for temporary use only.

Source from the content-addressed store, hash-verified

140// Very easy to insert bugs in your code, which is why it is called segmentTemp to indicate
141// that it is a ByteVector for temporary use only.
142const ByteVectorTemp ByteVector::segmentTemp(size_t start, size_t span) const
143{
144 BVASSERT(start+span <= size());
145 ByteType* wStart = mStart + start;
146 ByteType* wEnd = wStart + span;
147 //BVASSERT(wEnd<=mEnd);
148 return ByteVectorTemp(wStart,wEnd);
149}
150
151// Copy other to this starting at start.
152// The 'this' ByteVector must be allocated large enough to hold other.

Callers 2

ByteVectorTestFunction · 0.80
engineWriteHighSideMethod · 0.80

Calls 1

ByteVectorTempClass · 0.85

Tested by

no test coverage detected