diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2023-05-08 10:41:49 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2023-05-10 01:30:54 -0700 |
commit | 3efefcceba59d570a13b1a7de32a0e8caaf74aee (patch) | |
tree | 1d2ad829c82f283fe6c15198275bbde685daff0e /src/widgets/styles/qstylesheetstyle.cpp | |
parent | ccd3b28aab33bd36f9c382cd38352f82396d25da (diff) |
QSlotObjectBase: move the m_ref after m_impl for Qt 7
This moves the padding that exists on 64-bit architectures from between
the two fields to the end of the the structure. In turns, this allows
certain ABIs to reuse the tail padding space of the base class to store
some information. It can only be used if the functor has alignment of 4
or less, but the interesting case is when it's an empty but final
functor.
The pahole report goes from:
struct CallableObject : QSlotObjectBase {
/* class QSlotObjectBase <ancestor>; */ /* 0 16 */
struct FinalFunctor func; /* 16 0 */
/* XXX last struct has 1 byte of padding */
/* size: 24, cachelines: 1, members: 2 */
/* padding: 8 */
/* paddings: 1, sum paddings: 1 */
} __attribute__((__aligned__(8)));
to (pahole gets very confused by this trick):
struct CallableObject : QSlotObjectBase {
/* class QSlotObjectBase <ancestor>; */ /* 0 16 */
/* XXX last struct has 4 bytes of padding */
/* XXX 65532 bytes hole, try to pack */
struct FinalFunctor func; /* 12 0 */
/* size: 16, cachelines: 1, members: 2 */
/* padding: 4 */
/* paddings: 2, sum paddings: 5 */
/* BRAIN FART ALERT! 16 bytes != 0 (member bytes) + 0 (member bits) + 65532 (byte holes) + 0 (bit holes), diff = -524160 bits */
} __attribute__((__aligned__(8)));
Change-Id: I3e3bfef633af4130a03afffd175d3be98511bae5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/styles/qstylesheetstyle.cpp')
0 files changed, 0 insertions, 0 deletions