summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qiodevice_p.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2021-12-12 14:23:58 +0100
committerMarc Mutz <marc.mutz@qt.io>2021-12-15 17:35:13 +0000
commit63a35898f4990963fe91acd565df49111a281fa4 (patch)
treec15819a5a9db3f0d4c3e40445b97b2fdb4cbf2c5 /src/corelib/io/qiodevice_p.h
parent7ef614017091d7b56ac905c43da035259583c077 (diff)
QIODevice: use QVLA to hold the ring buffers, not QList
The only users of more than one read- or write channel are the SCTP code and QProcess. SCTP being pretty rare, optimize for the common case of at most two QRingBuffers for reading (QProcess) and one for writing. Even with more channels, QVLA shouldn't be slower than QList - on the contrary. Need to adjust tst_toolsupport and TypeInformationVersion, as QFilePrivate::fileName has changed. Pick-to: 6.3 Change-Id: I3baf982ba1f4dc51463be8730e414f6164072d8b Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/io/qiodevice_p.h')
-rw-r--r--src/corelib/io/qiodevice_p.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/io/qiodevice_p.h b/src/corelib/io/qiodevice_p.h
index 83c16eeddc..e9a8af0855 100644
--- a/src/corelib/io/qiodevice_p.h
+++ b/src/corelib/io/qiodevice_p.h
@@ -53,9 +53,9 @@
#include "QtCore/qbytearray.h"
#include "QtCore/qiodevice.h"
-#include "QtCore/qlist.h"
#include "QtCore/qobjectdefs.h"
#include "QtCore/qstring.h"
+#include "QtCore/qvarlengtharray.h"
#include "private/qringbuffer_p.h"
#ifndef QT_NO_QOBJECT
#include "private/qobject_p.h"
@@ -134,8 +134,8 @@ public:
int readBufferChunkSize = QIODEVICE_BUFFERSIZE;
int writeBufferChunkSize = 0;
- QList<QRingBuffer> readBuffers;
- QList<QRingBuffer> writeBuffers;
+ QVarLengthArray<QRingBuffer, 2> readBuffers;
+ QVarLengthArray<QRingBuffer, 1> writeBuffers;
QString errorString;
QIODevice::OpenMode openMode = QIODevice::NotOpen;