diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-10-16 11:24:21 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-12-09 21:18:23 +0000 |
commit | a8df9a20a79fe396f02d19f6a93554f09d59353b (patch) | |
tree | 11fbabbb6c8cc1cda019b3933a80b42f5220aa3e /src/qml | |
parent | 361d4bdf548cae2c56d681f550b185bbad7e3ba8 (diff) |
QV4::Heap::SharedArrayBuffer: avoid std::aligned_storage (deprecated in C++23)
... by rolling our own.
Qt 5.15 uses a pointer (additional indirection), not aligned_storage,
so isn't affected.
References:
- https://github.com/cplusplus/papers/issues/197
- https://wg21.link/p1413
Manual conflict resolutions:
- adapted to different member names and private/public access in the
6.2 class vis-a-vis the 6.4+ version.
Task-number: QTBUG-99122
Change-Id: Ia116dc11336901a19fc227fb68ac266c1bfbbcb1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 6e9a9ed121ce101d19e015de03b8f1d37fa84041)
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/jsruntime/qv4arraybuffer_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4arraybuffer_p.h b/src/qml/jsruntime/qv4arraybuffer_p.h index 4b2c1b83da..7e0d642116 100644 --- a/src/qml/jsruntime/qv4arraybuffer_p.h +++ b/src/qml/jsruntime/qv4arraybuffer_p.h @@ -72,7 +72,7 @@ struct Q_QML_PRIVATE_EXPORT SharedArrayBuffer : Object { void init(size_t length); void init(const QByteArray& array); void destroy(); - std::aligned_storage_t<sizeof(QArrayDataPointer<char>), alignof(QArrayDataPointer<char>)> d; + struct { alignas(QArrayDataPointer<char>) unsigned char data[sizeof(QArrayDataPointer<char>)]; } d; const QArrayDataPointer<char> &data() const { return *reinterpret_cast<const QArrayDataPointer<char> *>(&d); } QArrayDataPointer<char> &data() { return *reinterpret_cast<QArrayDataPointer<char> *>(&d); } bool isShared; |