summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qdatastream_p.h
Commit message (Collapse)AuthorAgeFilesLines
* QDataStream: Move trasactionDepth to the main classThiago Macieira2024-03-121-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The q_status member has too much space dedicated to it: 32 bits. So we can shrink it to a mere 8 bits and move it up to the 1-byte padding hole and repurpose the space it used to use. This only works because the q_status member was not accessed by any inline function before Qt 6.8 (see commit fc23fa459c5924bf1cc4564c7bce1fd59d7c972b). After this, pahole says: class QScopedPointer<QDataStreamPrivate> d; /* 0 8 */ class QIODevice * dev; /* 8 8 */ bool owndev; /* 16 1 */ bool noswap; /* 17 1 */ quint8 fpPrecision; /* 18 1 */ quint8 q_status; /* 19 1 */ enum ByteOrder byteorder; /* 20 4 */ int ver; /* 24 4 */ quint16 transactionDepth; /* 28 2 */ /* size: 32, cachelines: 1, members: 10 */ That leaves 16 bits of tail padding unused, so reduces the maximum number of nested transactions to 65536. That is to support a Qt 7 layout in an upcoming commit. Change-Id: I50e2158aeade4256ad1dfffd17b29d75fd13f472 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QDataStream: inline floatingPointPrecision()Thiago Macieira2024-03-121-5/+1
| | | | | | | | | | | | | | | | | | | | | | There is a 2-byte padding in all architectures between the noswap member and byteorder, because the latter requires a 32-bit alignment. So we can use this space to store this little-used field and avoid one more reason for QDataStreamPrivate. Now: class QScopedPointer<QDataStreamPrivate> d; /* 0 8 */ class QIODevice * dev; /* 8 8 */ bool owndev; /* 16 1 */ bool noswap; /* 17 1 */ quint8 fpPrecision; /* 18 1 */ /* XXX 1 byte hole, try to pack */ enum ByteOrder byteorder; /* 20 4 */ int ver; /* 24 4 */ enum Status q_status; /* 28 4 */ /* size: 32, cachelines: 1, members: 9 */ Change-Id: I50e2158aeade4256ad1dfffd17b29c2c5db02c12 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Create corelib/serialization and move existing file formats into itThiago Macieira2018-01-261-0/+73
This is in preparation to adding CBOR support. We don't need yet another dir for CBOR and placing it in src/corelib/json is just wrong. Change-Id: I9741f017961b410c910dfffd14ffb9d870340fa6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>