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

Containers Growth Strategy Out of Date

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.13.0
    • Documentation
    • None
    • All

      The documentation regarding how Qt allocates storage dynamically using containers such as QString, QByteArray, and others is extremely out of date.

       

      Here are the docs: https://doc.qt.io/qt-5/containers.html#growth-strategies

      The claim is that memory is allocated in 4KB pages after a certain point. 

       

      However, according to this commit, Qt switched over to using power-of-two allocation like many other languages/implementations use today. See here: https://github.com/qt/qtbase/commit/fb8be9905d5f3216edc3fbb72b8ce1c380737eac

       

      It was misleading to me at first since I was wondering how allocating in 4KB pages would be any better than doing a power-of-two allocation.

        For Gerrit Dashboard: QTBUG-77275
        # Subject Branch Project Status CR V

            docteam Qt Documentation Team
            addisonelliott Addison Elliott
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change