qt5base-lts/tests/auto/corelib
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
..
animation macOS: Blacklist tst_QSequentialAnimationGroup::groupWithZeroDurationAnimations() 2017-11-03 21:15:08 +00:00
codecs Replace Q_DECL_OVERRIDE with override where possible 2017-09-19 11:53:42 +00:00
global Use dependencies instead of CONFIG+=ordered 2017-12-02 11:09:15 +00:00
io Merge remote-tracking branch 'origin/5.10' into dev 2017-11-30 09:16:58 +01:00
itemmodels QSortFilterProxyModel: Clear persistent indexes on source model change 2017-11-30 17:29:33 +00:00
json Improve symmetry of variant json conversions 2017-07-25 09:00:46 +00:00
kernel Remove testQuitLock from BLACKLIST 2017-12-14 21:07:39 +00:00
mimetypes QMimeDatabase: handle removal of a mime directory 2017-11-30 12:54:52 +00:00
plugin Remove spurious execute permissions 2017-12-08 13:27:42 +00:00
statemachine Replace Q_DECL_OVERRIDE with override where possible 2017-09-19 11:53:42 +00:00
thread Use dependencies instead of CONFIG+=ordered 2017-12-02 11:09:15 +00:00
tools QRingBuffer: avoid reallocations of the data 2017-12-30 10:15:10 +00:00
xml QXmlStreamWriter: Avoid writing invalid characters 2017-09-13 07:29:00 +00:00
corelib.pro Add support for Apple tvOS 2016-05-17 16:11:23 +00:00