Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.15.12, 6.4.2
-
None
-
506d23775 (dev), dec1e2805 (6.5)
-
DaVinci 77, DaVinci 78, DaVinci 79
Description
It is often useful to allocate a QByteArray without explicitly initializing the content as it will immediately be filled out by some other means (eg reading from file)
The constructor QByteArray data(byteCount, Qt::Uninitialized) appears to do this, but it is not documented anywhere.
Note: In reality, many allocators do in fact null out allocated data for security reasons, so usually only the performance difference is visible unless you're using a debug or custom allocator.
Attachments
For Gerrit Dashboard: QTBUG-111582 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
477557,2 | Doc: Make QByteArray(qsizetype size, Qt::Initialization) doc public | dev | qt/qtbase | Status: MERGED | +2 | 0 |
477819,2 | Doc: Make QByteArray(qsizetype size, Qt::Initialization) doc public | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |