QObjectPrivate:Connection:: use NSDMI for the ref count
Can't use it for the bit in the bit field until C++20. Change-Id: If2e0f4b2190341ebaa31fffd16e313f64d52c26a Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
parent
06c2478762
commit
c87c2b0544
@ -131,7 +131,7 @@ struct QObjectPrivate::Connection : public ConnectionOrSignalVector
|
|||||||
QtPrivate::QSlotObjectBase *slotObj;
|
QtPrivate::QSlotObjectBase *slotObj;
|
||||||
};
|
};
|
||||||
QAtomicPointer<const int> argumentTypes;
|
QAtomicPointer<const int> argumentTypes;
|
||||||
QAtomicInt ref_;
|
QAtomicInt ref_{2}; //ref_ is 2 for the use in the internal lists, and for the use in QMetaObject::Connection
|
||||||
uint id = 0;
|
uint id = 0;
|
||||||
ushort method_offset;
|
ushort method_offset;
|
||||||
ushort method_relative;
|
ushort method_relative;
|
||||||
@ -140,9 +140,7 @@ struct QObjectPrivate::Connection : public ConnectionOrSignalVector
|
|||||||
ushort isSlotObject : 1;
|
ushort isSlotObject : 1;
|
||||||
ushort ownArgumentTypes : 1;
|
ushort ownArgumentTypes : 1;
|
||||||
ushort isSingleShot : 1;
|
ushort isSingleShot : 1;
|
||||||
Connection() : ref_(2), ownArgumentTypes(true) {
|
Connection() : ownArgumentTypes(true) { }
|
||||||
//ref_ is 2 for the use in the internal lists, and for the use in QMetaObject::Connection
|
|
||||||
}
|
|
||||||
~Connection();
|
~Connection();
|
||||||
int method() const { Q_ASSERT(!isSlotObject); return method_offset + method_relative; }
|
int method() const { Q_ASSERT(!isSlotObject); return method_offset + method_relative; }
|
||||||
void ref() { ref_.ref(); }
|
void ref() { ref_.ref(); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user