qt5base-lts/tests/auto/corelib
Thiago Macieira 961620824c QArrayData: make calculateBlockSize() account for the extra null element
Instead of adding it after the block size was calculated. This makes no
difference for non-growing (exact) blocks. For growing blocks, this
means we take that extra element into account before rounding to the
next power of two, instead of after. That results in a change of the
thresholds of when a block grows and also what capacity it will
contain.

For example, for a QString growing to 22-25 elements:

      Request     |       Previously        |           Now           |
elements |  bytes | malloc()ed | capacity() | malloc()ed | capacity() |
    22   |    44  |        66  |        24  |        64  |        23  |
    23   |    46  |        66  |        24  |        64  |        23  |
    24   |    48  |        66  |        24  |       128  |        55  |
    25   |    50  |       130  |        56  |       128  |        55  |

To avoid wasting elementSize - 2 bytes in this footer, we only include
this footer if elementSize <= 2. Thus, for a QList<int> growing to 11-13
elements:

      Request     |       Previously        |           Now           |
elements |  bytes | malloc()ed | capacity() | malloc()ed | capacity() |
    11   |    44  |        66  |        12  |        64  |        12  |
    12   |    48  |        66  |        12  |       128  |        28  |
    13   |    52  |       130  |        28  |       128  |        28  |

In both cases, we now only allocate powers of two while growing, which
may be beneficial to some allocators.

Pick-to: 6.6
Change-Id: Ifa1111900d6945ea8e05fffd177dcb96e251d0a1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-09-03 17:43:24 -07:00
..
animation QSequentialAnimationGroup: extend bindable property unit tests 2023-09-03 18:20:21 +02:00
global Add 'thread_local' definition as it is not available in C mode for VxWorks 2023-08-29 13:27:06 +00:00
io tst_QFileInfo: don't trigger libstdc++ std::filesystem bug 2023-09-01 13:05:45 -07:00
ipc QNativeIpcKey: add qHash() function 2023-07-25 12:31:04 +02:00
itemmodels QAbstractProxyModel: fix binding loops 2023-09-03 18:20:33 +02:00
kernel QTimer: extend property tests and fix binding loop 2023-09-03 18:20:51 +02:00
mimetypes QMimeDatabase: fix detection of pattern conflict in different prefixes 2023-09-01 15:04:33 +02:00
platform CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
plugin QUuid: convert bswap(Id128Bytes) to a hidden friend of Id128Bytes 2023-08-18 18:00:09 +02:00
serialization Rename accent color in QPalette 2023-08-18 00:38:38 +02:00
text QAnyStringView: fix construction from QL1SV for bootstrapped builds 2023-09-03 18:22:06 +02:00
thread Mark all of Qt as free of Q_FOREACH, except where it isn't 2023-08-19 05:19:42 +00:00
time Update QTimeZone data to CLDR v43 2023-08-07 19:51:09 +02:00
tools QArrayData: make calculateBlockSize() account for the extra null element 2023-09-03 17:43:24 -07:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00