89b0364cde
Since its initial implementation, QRingBuffer had the following fragilities in the architecture: - it does not guarantee validity of the pointers, if new data will be appended. As an example, passing an address of the QRingBuffer chunk as a parameter to the WriteFileEx() function on Windows requires the stability of the pointer. So, we can't add new data to the QRingBuffer until the overlapped operation completed (related issues were fixed for QWindowsPipeWriter and QSerialPort in 5.6 branch by introducing an intermediate byte array); - inefficient reallocations in reserve(), if a shared chunk was inserted in the queue (we can get a reallocation in the place where we don't expect it: char *writePtr = buffers.last().data() + tail; <- line #133 ). Proposed solution is to avoid reallocation by allocating a new block instead. That was accomplished by introducing a QRingChunk class which operates on a fixed byte array and implements head/tail pointers strategy for each individual buffer in the queue. So, QRingBuffer is no longer dependent on QByteArray's internal shrink/growth algorithms. Change-Id: I05abab0ad78e22e4815a196037dfc6eff85325d1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> |
||
---|---|---|
.. | ||
collections | ||
containerapisymmetry | ||
qalgorithms | ||
qarraydata | ||
qarraydata_strictiterators | ||
qbitarray | ||
qbytearray | ||
qbytearraylist | ||
qbytearraymatcher | ||
qbytedatabuffer | ||
qcache | ||
qchar | ||
qcollator | ||
qcommandlineparser | ||
qcontiguouscache | ||
qcryptographichash | ||
qdate | ||
qdatetime | ||
qeasingcurve | ||
qexplicitlyshareddatapointer | ||
qfreelist | ||
qhash | ||
qhash_strictiterators | ||
qhashfunctions | ||
qlatin1string | ||
qline | ||
qlinkedlist | ||
qlist | ||
qlist_strictiterators | ||
qlocale | ||
qmacautoreleasepool | ||
qmap | ||
qmap_strictiterators | ||
qmargins | ||
qmessageauthenticationcode | ||
qpair | ||
qpoint | ||
qpointf | ||
qqueue | ||
qrect | ||
qregexp | ||
qregularexpression | ||
qringbuffer | ||
qscopedpointer | ||
qscopedvaluerollback | ||
qset | ||
qsharedpointer | ||
qsize | ||
qsizef | ||
qstl | ||
qstring | ||
qstring_no_cast_from_bytearray | ||
qstringapisymmetry | ||
qstringbuilder | ||
qstringiterator | ||
qstringlist | ||
qstringmatcher | ||
qstringref | ||
qstringview | ||
qtextboundaryfinder | ||
qtime | ||
qtimeline | ||
qtimezone | ||
qvarlengtharray | ||
qvector | ||
qvector_strictiterators | ||
qversionnumber | ||
tools.pro |