From 3b46f07ffa2e471eaf0f3cca5f18952044db32a6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 5 Apr 2022 13:36:42 -0700 Subject: QObjectPrivate: mark inline functions not meant to be used elsewhere The `inline` keyword does not control inlining, as we all know (use Q_ALWAYS_INLINE to force inlining, if required). However, it does control the emission of the out-of-line copy of an inline function, if the compiler did inline it where it got used: with the keyword, no copy is required, which is our objective here. Furthermore, we compile with -fvisibility-inlines-hidden with GCC-compatible compilers (all but MSVC and Integrity's), which means those functions will never be in the ABI of QtCore: they'll either have been inlined with no out-of-line copy, or that out-of-line emission is hidden. Change-Id: If2e0f4b2190341ebaa31fffd16e31584561669f2 Reviewed-by: Lars Knoll Reviewed-by: Marc Mutz --- src/corelib/kernel/qobject_p.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib/kernel/qobject_p.h') diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index ed32a90497..5de0e53d4b 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -173,7 +173,7 @@ public: QObjectList receiverList(const char *signal) const; QObjectList senderList() const; - void addConnection(int signal, Connection *c); + inline void addConnection(int signal, Connection *c); static QObjectPrivate *get(QObject *o) { return o->d_func(); } static const QObjectPrivate *get(const QObject *o) { return o->d_func(); } @@ -211,9 +211,9 @@ public: static bool disconnect(const QObject *sender, int signal_index, void **slot); static bool disconnect(const QObject *sender, int signal_index, const QObject *receiver, void **slot); - static bool disconnect(Connection *c); + static inline bool disconnect(Connection *c); - void ensureConnectionData(); + inline void ensureConnectionData(); virtual std::string flagsForDumping() const; -- cgit v1.2.3