From d986c3c2041ea7eeb46b4a1a95b82c4a9905bb2c Mon Sep 17 00:00:00 2001 From: Joerg Date: Sun, 9 Jun 2024 20:02:54 +0200 Subject: [PATCH] Memory alignment of ControlDoublePrivate to reduce size from 464 byte to 448 byte First fields fit in 128 byte SSE register now --- src/control/control.cpp | 14 +++++++------- src/control/control.h | 39 +++++++++++++++++++++------------------ 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/control/control.cpp b/src/control/control.cpp index c6a88b889f11..ef2066baf01b 100644 --- a/src/control/control.cpp +++ b/src/control/control.cpp @@ -30,14 +30,14 @@ QWeakPointer s_pDefaultCO; } // namespace ControlDoublePrivate::ControlDoublePrivate() - : m_bPersistInConfiguration(false), - m_bIgnoreNops(true), - m_bTrack(false), - m_trackType(Stat::UNSPECIFIED), + : m_trackType(Stat::UNSPECIFIED), m_trackFlags(Stat::COUNT | Stat::SUM | Stat::AVERAGE | Stat::SAMPLE_VARIANCE | Stat::MIN | Stat::MAX), + m_bTrack(false), // default CO is read only m_confirmRequired(true), + m_bPersistInConfiguration(false), + m_bIgnoreNops(true), m_kbdRepeatable(false) { m_value.setValue(0.0); } @@ -51,13 +51,13 @@ ControlDoublePrivate::ControlDoublePrivate( double defaultValue) : m_key(key), m_pCreatorCO(pCreatorCO), - m_bPersistInConfiguration(bPersist), - m_bIgnoreNops(bIgnoreNops), - m_bTrack(bTrack), m_trackType(Stat::UNSPECIFIED), m_trackFlags(Stat::COUNT | Stat::SUM | Stat::AVERAGE | Stat::SAMPLE_VARIANCE | Stat::MIN | Stat::MAX), + m_bTrack(bTrack), m_confirmRequired(false), + m_bPersistInConfiguration(bPersist), + m_bIgnoreNops(bIgnoreNops), m_kbdRepeatable(false) { initialize(defaultValue); } diff --git a/src/control/control.h b/src/control/control.h index a33c4648f1f8..8afadd3ceaa4 100644 --- a/src/control/control.h +++ b/src/control/control.h @@ -183,8 +183,29 @@ class ControlDoublePrivate : public QObject { const ConfigKey m_key; + QSharedPointer m_pBehavior; + + // User-visible, i18n name for what the control is. + QString m_name; + + // User-visible, i18n description for what the control does. + QString m_description; + + // The control value. + ControlValueAtomic m_value; + // The default control value. + ControlValueAtomic m_defaultValue; + QAtomicPointer m_pCreatorCO; + QString m_trackKey; + + // Whether to track value changes with the stats framework. + int m_trackType; + int m_trackFlags; + bool m_bTrack; + bool m_confirmRequired; + // Whether the control should persist in the Mixxx user configuration. The // value is loaded from configuration when the control is created and // written to the configuration when the control is deleted. @@ -193,28 +214,10 @@ class ControlDoublePrivate : public QObject { // Whether to ignore sets which would have no effect. bool m_bIgnoreNops; - // Whether to track value changes with the stats framework. - bool m_bTrack; - QString m_trackKey; - int m_trackType; - int m_trackFlags; - bool m_confirmRequired; - - // User-visible, i18n name for what the control is. - QString m_name; - - // User-visible, i18n description for what the control does. - QString m_description; // If true, this control will be issued repeatedly if the keyboard key is held. bool m_kbdRepeatable; - // The control value. - ControlValueAtomic m_value; - // The default control value. - ControlValueAtomic m_defaultValue; - - QSharedPointer m_pBehavior; }; /// The constant ControlDoublePrivate version is used as dummy for default