diff options
author | Thiago Macieira <[email protected]> | 2024-12-31 17:12:46 -0300 |
---|---|---|
committer | Qt Cherry-pick Bot <[email protected]> | 2025-01-19 23:05:33 +0000 |
commit | 085780b3d858aeee4157fb618954f2a61363464e (patch) | |
tree | 86b2c284ebb68e410bf04fe02b7bbc929fdf3abc | |
parent | 4a451597f7f3ab056aaae2ed256e98ba7b6d1ca2 (diff) |
QMutex: mark the out-of-line, *Internal() methods Q_NEVER_INLINE
With LTO, I'm seeing GCC conclude that it's best to inline the
lockInternal() and unlockInternal() methods into the public ones and
then emit out-of-line copies for those. That's actually sub-optimal, so
force GCC not to do it.
Change-Id: I88c29098757ea6e70c00fffde56989ec05b136bd
Reviewed-by: MÃ¥rten Nordheim <[email protected]>
(cherry picked from commit cc4abefb1db3bdfee0d57ea528d55073a4498b4d)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
(cherry picked from commit 7920772663b7955b5abd269398d58753caf71248)
-rw-r--r-- | src/corelib/thread/qmutex.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp index ec6c711a4f2..33e96a24c2d 100644 --- a/src/corelib/thread/qmutex.cpp +++ b/src/corelib/thread/qmutex.cpp @@ -637,6 +637,7 @@ void QRecursiveMutex::unlock() noexcept /*! \internal helper for lock() */ +Q_NEVER_INLINE void QBasicMutex::lockInternal() QT_MUTEX_LOCK_NOEXCEPT { if (futexAvailable()) { @@ -670,6 +671,7 @@ bool QBasicMutex::lockInternal(int timeout) QT_MUTEX_LOCK_NOEXCEPT /*! \internal helper for tryLock(QDeadlineTimer) */ +Q_NEVER_INLINE bool QBasicMutex::lockInternal(QDeadlineTimer deadlineTimer) QT_MUTEX_LOCK_NOEXCEPT { if (deadlineTimer.hasExpired()) @@ -809,6 +811,7 @@ bool QBasicMutex::lockInternal(QDeadlineTimer deadlineTimer) QT_MUTEX_LOCK_NOEXC /*! \internal */ +Q_NEVER_INLINE void QBasicMutex::unlockInternal() noexcept { QMutexPrivate *copy = d_ptr.loadAcquire(); |