diff options
author | FranklinDM <mrmineshafter17@gmail.com> | 2023-03-17 19:44:09 +0800 |
---|---|---|
committer | FranklinDM <mrmineshafter17@gmail.com> | 2023-03-17 20:29:23 +0800 |
commit | d8a518b4db8ad7388da02a1e4692864fa8f2f752 (patch) | |
tree | 3031caf4f2c92f7953c59ac1522aeda520b69bf5 /mfbt | |
parent | a343d564a602603d95e2c0e2124ff9ead978c091 (diff) | |
download | uxp-d8a518b4db8ad7388da02a1e4692864fa8f2f752.tar.gz |
Issue #2166 - Part 6: Remove mozilla::AlignedStorage
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1341951
Diffstat (limited to 'mfbt')
-rw-r--r-- | mfbt/Alignment.h | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/mfbt/Alignment.h b/mfbt/Alignment.h index 6dbf2eae66..13a5c8a354 100644 --- a/mfbt/Alignment.h +++ b/mfbt/Alignment.h @@ -98,36 +98,6 @@ struct AlignedElem<16> MOZ_ALIGNED_DECL(uint8_t elem, 16); }; -/* - * This utility pales in comparison to Boost's aligned_storage. The utility - * simply assumes that uint64_t is enough alignment for anyone. This may need - * to be extended one day... - * - * As an important side effect, pulling the storage into this template is - * enough obfuscation to confuse gcc's strict-aliasing analysis into not giving - * false negatives when we cast from the char buffer to whatever type we've - * constructed using the bytes. - */ -template<size_t Nbytes> -struct AlignedStorage -{ - union U - { - char mBytes[Nbytes]; - uint64_t mDummy; - } u; - - const void* addr() const { return u.mBytes; } - void* addr() { return u.mBytes; } - - AlignedStorage() = default; - - // AlignedStorage is non-copyable: the default copy constructor violates - // strict aliasing rules, per bug 1269319. - AlignedStorage(const AlignedStorage&) = delete; - void operator=(const AlignedStorage&) = delete; -}; - template<typename T> struct MOZ_INHERIT_TYPE_ANNOTATIONS_FROM_TEMPLATE_ARGS AlignedStorage2 { |