qt5base-lts/tests/auto/corelib/tools/qarraydata
Thiago Macieira 42f974f56b Add QArrayData::reallocateUnaligned for QString and QByteArray
This function reallocates a QArrayData block with realloc() but, as
the name says, it's only valid for types that do not increase the
alignment requirements. I don't think it's worth doing this for types
that do increase the alignment requirements, since we don't know the
alignment of the pointer returned by realloc(). If the new pointer
modulo the alignment is different from the old pointer modulo the
alignment, we'd have to memmove data around, which would be quite
inefficient (realloc might have memcpy'ed already and this memmove
would copy data to nearby).

This function is intended to be used especially in QString and
QByteArray, which were already using realloc() on pointers created by
QArrayData::allocate.

Change-Id: I45b61247db2e84797ad794c1049c47a09c1fb29a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-09-07 14:35:51 +00:00
..
qarraydata.pro Tests: Remove CONFIG += parallel_test. 2015-09-05 07:16:50 +00:00
simplevector.h Merge remote-tracking branch 'origin/5.6' into 5.7 2016-05-19 12:55:27 +02:00
tst_qarraydata.cpp Add QArrayData::reallocateUnaligned for QString and QByteArray 2016-09-07 14:35:51 +00:00