QTimerInfo: re-pack the members
0148c6925ec3b6b9a9d2f57ae44fea292a6625e1 added support for qint64 intervals in the abstract dispatcher. Changing the `int` interval to `qint64` causes padding in the QTimerInfo struct. On X86-64: struct TimerInfo { int id; /* 0 4 */ /* XXX 4 bytes hole, try to pack */ qint64 interval; /* 8 8 */ enum TimerType timerType; /* 16 4 */ /* XXX 4 bytes hole, try to pack */ struct timespec timeout; /* 24 16 */ class QObject * obj; /* 40 8 */ class QTimerInfo * * activateRef; /* 48 8 */ /* size: 56, cachelines: 1, members: 6 */ /* sum members: 48, holes: 2, sum holes: 8 */ /* last cacheline: 56 bytes */ }; On ARM32: struct TimerInfo { int id; /* 0 4 */ /* XXX 4 bytes hole, try to pack */ qint64 interval; /* 8 8 */ enum TimerType timerType; /* 16 4 */ struct timespec timeout; /* 20 8 */ class QObject * obj; /* 28 4 */ class QTimerInfo * * activateRef; /* 32 4 */ /* size: 40, cachelines: 1, members: 6 */ /* sum members: 32, holes: 1, sum holes: 4 */ /* padding: 4 */ /* last cacheline: 40 bytes */ }; Change the order of the members, so we remove the padding: struct TimerInfo { int id; /* 0 4 */ enum TimerType timerType; /* 4 4 */ qint64 interval; /* 8 8 */ struct timespec timeout; /* 16 16 */ class QObject * obj; /* 32 8 */ class QTimerInfo * * activateRef; /* 40 8 */ /* size: 48, cachelines: 1, members: 6 */ /* last cacheline: 48 bytes */ }; Change-Id: Ia1cc56e497f87611fa411a19361f8ebb13ff1f67 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 7f1d3c09c9620d6aa5c7c94429e0e2a10a82b6d6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
2e4613184f
commit
b4b80e0794
@ -28,8 +28,8 @@ QT_BEGIN_NAMESPACE
|
||||
// internal timer info
|
||||
struct QTimerInfo {
|
||||
int id; // - timer identifier
|
||||
qint64 interval; // - timer interval in milliseconds
|
||||
Qt::TimerType timerType; // - timer type
|
||||
qint64 interval; // - timer interval in milliseconds
|
||||
timespec timeout; // - when to actually fire
|
||||
QObject *obj; // - object to receive event
|
||||
QTimerInfo **activateRef; // - ref from activateTimers
|
||||
|
Loading…
x
Reference in New Issue
Block a user