qt5base-lts/src
Volker Hilsheimer b7d073e990 Refactor memory allocation for arguments of QMetaCallEvents
There are two cases:

In a BlockingQueuedConnection, QMetaCallEvent doesn't allocate memory
and instead passes already existing pointers through. A QSemaphore
is used to serialize data access between threads. So the constructor
taking a QSemaphore can be simplified to only accept an existing arg
array.

In a QueuedConnection, QMetaCallEvent needs to make deep copies of
the arguments, and memory needs to be allocated based on the number
of arguments. The previous code put the burden of memory allocation
on the code generating the event, while the memory was free'd by
~QMetaCallEvent. Instead, make it QMetaCallEvent's responsibility
to allocate and free the memory as needed, and adjust the code
generating QMetaCallEvents.

We can allocate the memory for types and pointers to arguments in a
single block, starting with the space for the array of void*, followed
by the space for the array of integers to avoid byte alignment issues.
By pre-allocating the space that's needed by three arguments, we can
avoid all mallocs for the majority of QMetaCallEvents.

Until this change has propagated through qt5.git, we need to keep the
old API that is still used by QtDeclarative around. Once QtDeclarative
has migrated to the new API, it can be removed.

Change-Id: Id7359ffc14897237ea9672dabae9ef199a821907
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-10 22:04:11 +02:00
..
3rdparty Merge remote-tracking branch 'origin/5.13' into dev 2019-07-01 10:21:37 +02:00
android Merge remote-tracking branch 'origin/5.13' into dev 2019-07-10 10:39:33 +02:00
angle Merge remote-tracking branch 'origin/5.12' into 5.13 2019-06-28 01:00:23 +02:00
concurrent Merge remote-tracking branch 'origin/5.13' into dev 2019-06-27 14:38:03 +02:00
corelib Refactor memory allocation for arguments of QMetaCallEvents 2019-08-10 22:04:11 +02:00
dbus Port users of QDBusAbstractInterface::(async)callWithArgumentList() to new variadic (async)Call() 2019-08-07 20:09:17 +00:00
gui doc: Fix text formatting in the CSS Properties table 2019-08-08 16:46:13 +02:00
network Refactor memory allocation for arguments of QMetaCallEvents 2019-08-10 22:04:11 +02:00
opengl Port some trivial cases from QMutex to QRecursiveMutex 2019-07-06 11:22:37 +02:00
openglextensions Move forward-declaration inside of namespace 2019-05-15 10:58:49 +00:00
platformheaders Merge remote-tracking branch 'origin/5.13' into dev 2019-06-27 14:38:03 +02:00
platformsupport Port users of QDBusAbstractInterface::(async)callWithArgumentList() to new variadic (async)Call() 2019-08-07 20:09:17 +00:00
plugins Port users of QDBusAbstractInterface::(async)callWithArgumentList() to new variadic (async)Call() 2019-08-07 20:09:17 +00:00
printsupport Port from QStringViewLiteral to u"" 2019-07-29 11:17:28 +03:00
sql Fix build without feature.stringlistmodel 2019-06-30 17:16:52 +09:00
testlib QTest: add toString(QBitArray) 2019-08-05 09:29:27 -07:00
tools uic: Avoid use of Q_UNUSED in the generated code 2019-07-30 09:34:36 +02:00
widgets Remove the unused includes for QSignalMapper 2019-08-05 10:15:57 +02:00
winmain Merge remote-tracking branch 'origin/5.13' into dev 2019-05-27 15:34:10 +02:00
xml Be less laissez-faire with implicit conversions to QChar 2019-07-09 07:09:44 +02:00
src.pro Merge remote-tracking branch 'origin/5.13' into dev 2019-07-17 10:44:21 +02:00