qt5base-lts/tests/auto/corelib
Fabian Kosmale c1c991c319 Remove std::function from QProperty interface
std::function as a type is rather unfortunate for us, as its SSO buffer
makes it rather large, and we can ensure that the function is never
empty.
Considering that we do need to allocate memory for
QPropertyBindingPrivate anyway, we can get rid of the SSO buffer and
instead coalesce the allocations (similar to how std::make_shared works).
The memory looks then like
[--QPropertyBindingPrivate--][Functor]
and QPropertyBindingPrivate can get a pointer to the functor via
reinterpret_cast<std::byte>(this)+sizeof(QPropertyBindingPrivate).
To actually do anything with the functor, we do however need a "vtable"
which describes how we can call, destroy and move the functor. This is
done by creating a constexpr struct of function pointers, and storing a
pointer to it in QPropertyBindingPrivate.

As a consequence of those changes, we cannot use QESDP anymore, as we
now have to carefully deallocate the buffer we used for both the
QPropertyBindingPrivate and the functor. We introduce a custom
refcounting pointer for that. While we're at it, we make the refcount
non-atomic, as bindings do not work across threads to begin with.

Moreover, we can now make the class non-virtual, as that was only needed
to hack around limitations of QESDP in the context of exported symbols.

Change-Id: Idc5507e4c120e28df5bd5aea717fe69f15e540dc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-11-03 13:06:14 +01:00
..
animation Remove timeStep parameter from QAnimationDrive::advanceAnimation 2020-10-13 08:44:42 +02:00
global QRandomGenerator: add 64-bit bounded() versions 2020-10-20 22:45:06 -07:00
io Forbid implicit conversions between QFuture and other types 2020-10-30 17:19:26 +01:00
itemmodels Remove QItemSelectionRange's operator<() 2020-10-28 15:27:37 +01:00
kernel Remove std::function from QProperty interface 2020-11-03 13:06:14 +01:00
mimetypes CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
plugin Deprecate QVariant::Type 2020-10-23 09:58:57 +02:00
serialization Update tst_qcborstreamwriter to use QMetaType 2020-10-30 22:18:21 +01:00
text Purge deprecated language and country codes from QLocale 2020-10-29 10:44:38 +00:00
thread Forbid implicit conversions between QFuture and other types 2020-10-30 17:19:26 +01:00
time Adapt QDate::fromString() to accept negative year numbers 2020-10-30 17:19:27 +01:00
tools Make QVarLengthArray comparisons hidden friends 2020-10-30 13:27:14 +01:00
.prev_CMakeLists.txt Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
CMakeLists.txt Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
corelib.pro Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00