summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qiodevice.cpp
diff options
context:
space:
mode:
authorAlex Trotsenko <alex1973tr@gmail.com>2020-08-11 14:42:44 +0300
committerAlex Trotsenko <alex1973tr@gmail.com>2020-08-13 20:37:50 +0300
commit707d29d5d7824063c6dd84295cc82636444e6d6a (patch)
tree455ba92175276c88f2ec490c5f85dfef8aa6f24c /src/corelib/io/qiodevice.cpp
parent1df02b5f980b01a4e42f32061f1cba696b6a22e9 (diff)
De-inline QIODevice::write(const QByteArray &)
Since QRingBuffer is used as a temporary store for data to be written to a buffered device, we can implement a "zero-copy" strategy between the user-space code and QIODevice's internal write buffer. As a first step, we should have an entry point, where we can implement a possible solution. Change-Id: I1c658c13accc98c65a802be943688359cc9f9917 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qiodevice.cpp')
-rw-r--r--src/corelib/io/qiodevice.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index 21718fede2..c29501404b 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -1739,8 +1739,7 @@ qint64 QIODevice::write(const char *data)
return write(data, qstrlen(data));
}
-/*! \fn qint64 QIODevice::write(const QByteArray &byteArray)
-
+/*!
\overload
Writes the content of \a byteArray to the device. Returns the number of
@@ -1749,6 +1748,11 @@ qint64 QIODevice::write(const char *data)
\sa read(), writeData()
*/
+qint64 QIODevice::write(const QByteArray &data)
+{
+ return write(data.constData(), data.size());
+}
+
/*!
Puts the character \a c back into the device, and decrements the
current position unless the position is 0. This function is