diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-10-16 11:24:21 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-10-17 09:38:45 +0200 |
commit | 6e9a9ed121ce101d19e015de03b8f1d37fa84041 (patch) | |
tree | 14701eea71af2571e434250b6aa499e5f0282dfa /src/qml/jsruntime/qv4arraybuffer_p.h | |
parent | 1aa0b1c3989eebcbdca6655648e397937c11fc24 (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
Pick-to: 6.4 6.2
Task-number: QTBUG-99122
Change-Id: Ia116dc11336901a19fc227fb68ac266c1bfbbcb1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4arraybuffer_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4arraybuffer_p.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4arraybuffer_p.h b/src/qml/jsruntime/qv4arraybuffer_p.h index cc322b3f01..b955618cbe 100644 --- a/src/qml/jsruntime/qv4arraybuffer_p.h +++ b/src/qml/jsruntime/qv4arraybuffer_p.h @@ -60,7 +60,10 @@ private: return *reinterpret_cast<QArrayDataPointer<char> *>(&arrayDataPointerStorage); } - std::aligned_storage_t<sizeof(QArrayDataPointer<char>), alignof(QArrayDataPointer<char>)> + template <typename T> + struct storage_t { alignas(T) unsigned char data[sizeof(T)]; }; + + storage_t<QArrayDataPointer<char>> arrayDataPointerStorage; bool isShared; }; |