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>
bb10
Alex Trotsenko 2020-08-11 14:42:44 +03:00
parent 1df02b5f98
commit 707d29d5d7
2 changed files with 7 additions and 4 deletions

View File

@ -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

View File

@ -133,8 +133,7 @@ public:
qint64 write(const char *data, qint64 len);
qint64 write(const char *data);
inline qint64 write(const QByteArray &data)
{ return write(data.constData(), data.size()); }
qint64 write(const QByteArray &data);
qint64 peek(char *data, qint64 maxlen);
QByteArray peek(qint64 maxlen);