Have QVectorData::grow, take size of header w/ padding
authorJoão Abecasis <joao.abecasis@nokia.com>
Fri, 17 Feb 2012 10:23:41 +0000 (11:23 +0100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 20 Feb 2012 16:52:27 +0000 (17:52 +0100)
commitebeebe212624b0d6fb87266629dce20ee75391bd
tree0fba86eea8512979658576ed2a6186a3cca477d2
parentec5eb45cd3e6d60744afd9e4b16e36fbba3eaf05
Have QVectorData::grow, take size of header w/ padding

This includes padding necessary to align the data array, but excludes the first
element as was done before. Size of header is the interesting piece of
information, anyway.

This simplifies calculations in a couple of places, harmonizes code with the
QRawVector fork and paves the way for further changes in QVector, namely the
memory layout.

When Q_ALIGNOF is not available, default to pointer-size alignment. This
should be honoured by malloc and won't trigger use of more expensive
aligned allocation.

Change-Id: I504022ac7595f69089cafd96e47a91b874d5771e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/tools/qvector.cpp
src/corelib/tools/qvector.h
tests/benchmarks/corelib/tools/qvector/qrawvector.h