From c3c2a0f75486b0dd10524219e99f6d88d023981c Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 4 Feb 2022 14:47:20 +0100 Subject: QDBusAdaptorConnector: place a static int into BSS instead of DATA The cachedRelaySlotMethodIndex started out as -1, assuming no slot could have that index. But 0 is just as good a marker, because we know that method index 0 will be one of QObject's (destroyed() or deleteLater()). So start out with a zero initial value, which means the variable can be placed in the BSS segment now and doesn't need to be stored in DATA. Pick-to: 6.3 6.2 Change-Id: I40b96d54f11e60348f465cafa15af98d41038c95 Reviewed-by: Thiago Macieira --- src/dbus/qdbusabstractadaptor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/dbus') diff --git a/src/dbus/qdbusabstractadaptor.cpp b/src/dbus/qdbusabstractadaptor.cpp index 8d99577929..d048ae2e52 100644 --- a/src/dbus/qdbusabstractadaptor.cpp +++ b/src/dbus/qdbusabstractadaptor.cpp @@ -58,13 +58,13 @@ QT_BEGIN_NAMESPACE -static int cachedRelaySlotMethodIndex = -1; +static int cachedRelaySlotMethodIndex = 0; int QDBusAdaptorConnector::relaySlotMethodIndex() { - if (cachedRelaySlotMethodIndex == -1) { + if (cachedRelaySlotMethodIndex == 0) { cachedRelaySlotMethodIndex = staticMetaObject.indexOfMethod("relaySlot()"); - Q_ASSERT(cachedRelaySlotMethodIndex != -1); + Q_ASSERT(cachedRelaySlotMethodIndex != 0); // 0 should be deleteLater() or destroyed() } return cachedRelaySlotMethodIndex; } -- cgit v1.2.3