Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13088,7 +13088,7 @@ bool writeDataSizeToSnapshot
||
(buff.Length >= offst + len)
||
(buff.Length == (startOffsetByteCount >> 1) + 1),
(buff.Length >= (startOffsetByteCount >> 1) + 1),
"Invalid length sent to ReadPlpUnicodeChars()!"
);
charsLeft = len;
Expand Down Expand Up @@ -13152,7 +13152,10 @@ bool writeDataSizeToSnapshot
}
else
{
newbuf = new char[offst + charsRead];
// grow by an arbitrary number of packets to avoid needing to reallocate
// the newbuf on each loop iteration of long packet sequences which causes
// a performance problem as we spend large amounts of time copying and in gc
newbuf = new char[offst + charsRead + (stateObj.GetPacketSize() * 8)];
rentedBuff = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,11 @@ internal bool SetPacketSize(int size)
return false;
}

internal int GetPacketSize()
{
return _inBuff.Length;
}

///////////////////////////////////////
// Buffer read methods - data values //
///////////////////////////////////////
Expand Down