summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qprocess.cpp
diff options
context:
space:
mode:
authorAlex Trotsenko <alex1973tr@gmail.com>2021-06-09 12:04:56 +0300
committerAlex Trotsenko <alex1973tr@gmail.com>2021-06-18 22:20:47 +0300
commit79490d2a4c1208d54104e3eed69739db700897c4 (patch)
tree37c3cf0a98660416bb5e4074ec4fe47407dfc0da /src/corelib/io/qprocess.cpp
parentbccfb92507dc23f7629ce9aa5c3aef3754cb1d8f (diff)
QProcess/Win: avoid double buffering on write
As QWindowsPipeWriter now maintains a chunk queue, there is no need to use the internal QIODevice buffer and wait for the previous operation to complete. This also allows us to get rid of the stdinWriteTrigger timer; however, as a trade-off, QWindowsPipeWriter now needs to accept data even before a handle is assigned. Change-Id: I17fe0e36a6165fe05100bfab3fe01fc0d880d617 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Diffstat (limited to 'src/corelib/io/qprocess.cpp')
-rw-r--r--src/corelib/io/qprocess.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 0702667042d..0f2de9e1ff7 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -782,7 +782,9 @@ void QProcessPrivate::Channel::clear()
QProcessPrivate::QProcessPrivate()
{
readBufferChunkSize = QRINGBUFFER_CHUNKSIZE;
+#ifndef Q_OS_WIN
writeBufferChunkSize = QRINGBUFFER_CHUNKSIZE;
+#endif
}
/*!
@@ -1585,11 +1587,11 @@ bool QProcess::isSequential() const
*/
qint64 QProcess::bytesToWrite() const
{
- qint64 size = QIODevice::bytesToWrite();
#ifdef Q_OS_WIN
- size += d_func()->pipeWriterBytesToWrite();
+ return d_func()->pipeWriterBytesToWrite();
+#else
+ return QIODevice::bytesToWrite();
#endif
- return size;
}
/*!