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

QVector: When copying a QVector then it will cause the memory to be reallocated soon after. Whereas with std::vector this is not the case

    XMLWordPrintable

Details

    • 44b7877c879faabe83310df697d1ec2f013ee8b5

    Description

      QVector: When copying a QVector then it will cause the memory to be reallocated soon after and can run out of memory earlier than it should. Whereas with std::vector this is not the case.

      In the example attached the USE_VECTOR define can be used to see the difference when compared from QVector to std::vector

      Attachments

        1. main.cpp
          1 kB
        2. main.cpp.new
          1 kB
        3. qvector.log
          2 kB
        4. stdvector.log
          0.4 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            liaqi Liang Qi
            anshaw Andy Shaw (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes