summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranklinDM <mrmineshafter17@gmail.com>2023-03-17 19:44:09 +0800
committerFranklinDM <mrmineshafter17@gmail.com>2023-03-17 20:29:23 +0800
commitd8a518b4db8ad7388da02a1e4692864fa8f2f752 (patch)
tree3031caf4f2c92f7953c59ac1522aeda520b69bf5
parenta343d564a602603d95e2c0e2124ff9ead978c091 (diff)
downloaduxp-d8a518b4db8ad7388da02a1e4692864fa8f2f752.tar.gz
Issue #2166 - Part 6: Remove mozilla::AlignedStorage
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1341951
-rw-r--r--mfbt/Alignment.h30
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
{