qt5base-lts/tests/auto/corelib/tools
Alex Trotsenko 89b0364cde QRingBuffer: avoid reallocations of the data
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>
2017-12-30 10:15:10 +00:00
..
collections Fix tst_Collections for gcc/arm 2017-04-07 05:54:04 +00:00
containerapisymmetry Add front()/back() to QString, QStringRef, QByteArray and QLatin1String 2017-04-07 08:32:32 +00:00
qalgorithms Change almost all other uses of qrand() to QRandomGenerator 2017-11-08 09:14:03 +00:00
qarraydata tst_QArrayData: fix unused variable warning in reallocate() 2017-03-22 09:22:34 +00:00
qarraydata_strictiterators
qbitarray
qbytearray Remove references to obsolete platforms 2017-11-05 06:33:53 +00:00
qbytearraylist
qbytearraymatcher Long live QStaticByteArrayMatcher! 2017-01-19 21:37:46 +00:00
qbytedatabuffer
qcache
qchar Use new Q_STDLIB_UNICODE_STRINGS and Q_COMPILER_UNICODE_STRINGS 2017-04-20 18:10:59 +00:00
qcollator macOS/iOS: Correctly ignore punctuation in QCollator 2017-06-13 04:08:56 +00:00
qcommandlineparser Properly use the "process" feature 2017-02-27 15:44:46 +00:00
qcontiguouscache
qcryptographichash QCryptographicHash: make SHA3 calculate SHA3, not Keccak 2017-03-31 07:58:35 +00:00
qdate Raise the upper bound on years to 9999 2017-11-30 20:19:13 +00:00
qdatetime Raise the upper bound on years to 9999 2017-11-30 20:19:13 +00:00
qeasingcurve
qexplicitlyshareddatapointer
qfreelist Use qtConfig throughout in qtbase 2016-08-19 04:28:05 +00:00
qhash Merge remote-tracking branch 'origin/5.9' into dev 2017-05-07 13:08:18 +02:00
qhash_strictiterators
qhashfunctions QHash: make it so a zero seed selects a constant algorithm 2017-04-26 15:22:44 +00:00
qlatin1string Replace Q_NULLPTR with nullptr where possible 2017-09-19 11:53:55 +00:00
qline Add QLineF::center() returning the point in the center of the line 2016-05-27 08:49:44 +00:00
qlinkedlist
qlist
qlist_strictiterators
qlocale QDateTimeParser: reject all short values in fixed-width fields 2017-11-30 20:19:29 +00:00
qmacautoreleasepool macOS: Detect use of heap-allocated QMacAutoReleasePool 2017-09-08 12:05:21 +00:00
qmap Implement key-value iterator 2017-05-05 14:25:56 +00:00
qmap_strictiterators
qmargins
qmessageauthenticationcode
qpair Merge remote-tracking branch 'origin/5.6' into 5.7 2016-07-15 20:47:57 +02:00
qpoint
qpointf
qqueue
qrect Improve rounding of QRect::toRect 2017-06-26 21:35:38 +00:00
qregexp
qregularexpression QRegularExpressionMatch: add QStringView-related functions 2017-04-04 15:35:22 +00:00
qringbuffer QRingBuffer: avoid reallocations of the data 2017-12-30 10:15:10 +00:00
qscopedpointer QScopedPointer: add get() 2017-09-17 11:42:26 +00:00
qscopedvaluerollback
qset
qsharedpointer Merge remote-tracking branch 'origin/5.10' into dev 2017-11-23 09:36:03 +01:00
qsize
qsizef
qstl
qstring Replace Q_NULLPTR with nullptr where possible 2017-09-19 11:53:55 +00:00
qstring_no_cast_from_bytearray
qstringapisymmetry Mark the previously public qstringalgorithms.h functions private 2017-10-29 10:13:13 +00:00
qstringbuilder QString: add some missing overloaded operator+ 2016-06-29 14:58:25 +00:00
qstringiterator QStringIterator: port to QStringView 2017-04-03 15:41:09 +00:00
qstringlist QStringList: add contains(QLatin1String) overload 2017-03-20 06:16:59 +00:00
qstringmatcher QStringMatcher: fix setCaseSensitivity() on a non-QString-backed matcher 2017-02-07 16:31:00 +00:00
qstringref Remove references to obsolete platforms 2017-11-05 06:33:53 +00:00
qstringview Improve qustrlen further by avoiding the alignment prologue 2017-09-26 18:19:35 +00:00
qtextboundaryfinder Use QT_CONFIG(library) instead of QT_NO_LIBRARY 2017-03-06 11:27:20 +00:00
qtime Raise the upper bound on years to 9999 2017-11-30 20:19:13 +00:00
qtimeline Blacklist flaky tst_QTimeLine tests on macOS 10.12 2017-06-18 12:58:53 +00:00
qtimezone Kludge round MS TZ APIs' lies breaking a test 2017-12-13 18:51:29 +00:00
qvarlengtharray Merge remote-tracking branch 'origin/5.9' into dev 2017-03-02 09:04:38 +01:00
qvector Replace Q_DECL_OVERRIDE with override where possible 2017-09-19 11:53:42 +00:00
qvector_strictiterators
qversionnumber QVersionNumber: add fromString(QStringView/QLatin1String) overloads 2017-04-08 05:40:52 +00:00
tools.pro macOS: Detect use of heap-allocated QMacAutoReleasePool 2017-09-08 12:05:21 +00:00