qt5base-lts/tests/auto
João Abecasis fb8be9905d qAllocMore: Always grow exponentially
qAllocMore is used by growing containers to allocate additional memory
for future growth. The previous algorithm would grow linearly in
increments of 8 up to 64 and then progress exponentially in powers of
two.

The new (constant time) algorithm does away with the linear segment and
always progresses exponentially. It also has the nice benefit of cleanly
avoiding undefined behaviour that the old implementation tried hard to
circumvent.

Besides always progressing exponentially, the next-power-of-two
algorithm was tweaked to always include space for growth. Previously
queries at boundary values (powers of two) would return the same value.

The test was updated to verify sanity of results. As the algorithm is
well behaved, testing of bogus data was dropped. Whatever happens in
those cases is irrelevant, anyway: the bug lives elsewhere.

Change-Id: I4def473cce4b438734887084e3c3bd8da0ff466b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-17 21:23:06 +01:00
..
bic Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
compilerwarnings/data Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
concurrent Move QtConcurrent into its own module 2012-02-05 17:49:16 +01:00
corelib qAllocMore: Always grow exponentially 2012-02-17 21:23:06 +01:00
dbus Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
gui Un-guard a QRawFont autotest. 2012-02-03 01:40:22 +01:00
guiapplauncher Update the documentation after moving examples. 2011-07-05 21:19:08 +02:00
network Don't include config.tests/unix/openssl/openssl.pri (again) 2012-02-03 01:40:07 +01:00
opengl Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
other Allow function types to be registered without workarounds 2012-01-31 16:17:55 +01:00
sql Handle the 'real' datatype correctly in the SQLite driver 2012-02-03 15:09:03 +01:00
testlib Fixed selftests unittest on windows 2012-02-02 05:42:07 +01:00
tools Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
widgets Remove QInputContext 2012-02-03 11:01:34 +01:00
xml Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
auto.pro Move QtConcurrent into its own module 2012-02-05 17:49:16 +01:00
network-settings.h Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
platformquirks.h Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
test.pl Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00