Go to file
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
bin Move QtConcurrent into its own module 2012-02-05 17:49:16 +01:00
config.tests Improve sysroot handling with regards to configure tests. 2012-02-03 18:59:09 +01:00
dist Remove constructors taking implicit string sizes 2012-02-14 15:25:37 +01:00
doc/src QString: Make convert to number methods only use C locale 2012-02-05 17:49:42 +01:00
examples Move QtConcurrent into its own module 2012-02-05 17:49:16 +01:00
lib Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
mkspecs fix gdb_dwarf_index.prf for applications, take two 2012-02-02 11:10:04 +01:00
qmake qmake: Work around MSVC compiler bug. 2012-02-05 19:03:18 +01:00
src qAllocMore: Always grow exponentially 2012-02-17 21:23:06 +01:00
tests qAllocMore: Always grow exponentially 2012-02-17 21:23:06 +01:00
tools Windows configure: make -mp affect the Qt build itself 2012-02-01 19:02:28 +01:00
util Avoid non-standard indentation of license headers. 2012-01-30 16:40:10 +01:00
.gitattributes Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
.gitignore Update .gitignore to ignore qmake/qmake_pch.pch 2012-02-03 06:05:02 +01:00
.tag Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
configure Use $CFG_ARCH even if src/corelib/arch/$CFG_ARCH does not exist 2012-02-04 22:40:06 +01:00
configure.exe Add a new QT_NO_SSL feature macro. 2012-01-06 11:19:23 +01:00
header.BSD Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
header.FDL Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
header.LGPL Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
header.LGPL-ONLY Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
INSTALL Remove Symbian specific code from qtbase. 2012-01-31 07:08:31 +01:00
LGPL_EXCEPTION.txt Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.LGPL Update contact information in license headers. 2012-01-23 04:04:33 +01:00
LICENSE.PREVIEW.COMMERCIAL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
qtbase.pro Remove Symbian specific code from qtbase. 2012-01-31 07:08:31 +01:00
sync.profile Move QtConcurrent into its own module 2012-02-05 17:49:16 +01:00