qt5base-lts/tests/auto/corelib/tools/qarraydata
João Abecasis f4c1e2c40f Enable QArrayData to reference external array data
By default, QTypedArrayData::fromRawData provides the same semantics as
already exist in QByteArray and QString (immutable, sharable data), but
more combinations are possible. In particular, immutable-unsharable
leaves the data owner in control of its lifetime by forcing deep copies.

As part of this, a new isMutable property is introduced in QArrayData.
This could be taken to be implicit in statics that are initialized with
a proper size but with alloc set to 0. QStringLiteral and QByteLiteral
already did this, forcing re-allocations on resize even before the
(static, thus shared) ref-count is considered.

The isMutable property detaches data mutability and shared status, which
are orthogonal concepts (at least in the unshared state). For the time
being, there is no API to explicitly (re)set mutability, but statics and
RawData mark data immutable.

Change-Id: I33a995a35e1c3d7a12391b1d7c36095aa28e221a
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-16 18:10:58 +01:00
..
qarraydata.pro SimpleVector as a test case for QArrayData 2011-12-07 02:01:42 +01:00
simplevector.h Enable QArrayData to reference external array data 2012-01-16 18:10:58 +01:00
tst_qarraydata.cpp Enable QArrayData to reference external array data 2012-01-16 18:10:58 +01:00