You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
MCOL-4810 Redundant copying and wasting memory in PrimProc
This patch eliminates a copying `long string`s into the bytestream.
This commit is contained in:
@ -59,6 +59,8 @@ void ByteStream::doCopy(const ByteStream& rhs)
|
||||
memcpy(fBuf + ISSOverhead, rhs.fCurOutPtr, rlen);
|
||||
fCurInPtr = fBuf + ISSOverhead + rlen;
|
||||
fCurOutPtr = fBuf + ISSOverhead;
|
||||
// Copy `longStrings` as well.
|
||||
longStrings = rhs.longStrings;
|
||||
}
|
||||
|
||||
ByteStream::ByteStream(const ByteStream& rhs) :
|
||||
@ -87,6 +89,8 @@ ByteStream& ByteStream::operator=(const ByteStream& rhs)
|
||||
delete [] fBuf;
|
||||
fBuf = fCurInPtr = fCurOutPtr = 0;
|
||||
fMaxLen = 0;
|
||||
// Clear `longStrings`.
|
||||
longStrings.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@ -152,6 +156,18 @@ void ByteStream::growBuf(uint32_t toSize)
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<boost::shared_array<uint8_t>>& ByteStream::getLongStrings() { return longStrings; }
|
||||
|
||||
const std::vector<boost::shared_array<uint8_t>>& ByteStream::getLongStrings() const
|
||||
{
|
||||
return longStrings;
|
||||
}
|
||||
|
||||
void ByteStream::setLongStrings(const std::vector<boost::shared_array<uint8_t>>& other)
|
||||
{
|
||||
longStrings = other;
|
||||
}
|
||||
|
||||
ByteStream& ByteStream::operator<<(const int8_t b)
|
||||
{
|
||||
if (fBuf == 0 || (fCurInPtr - fBuf + 1U > fMaxLen + ISSOverhead))
|
||||
|
Reference in New Issue
Block a user