Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-111582

QByteArray(int size, Qt::Initialization) is not documented

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.5.2, 6.6.0
    • 5.15.12, 6.4.2
    • Documentation
    • 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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            treinio Topi Reiniƶ
            rthompson Richard Thompson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes