_sparc_unaligned_access
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Thu, 11 Aug 2016 01:13:17 +0000 (01:13 +0000)
committerLisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>
Thu, 11 Aug 2016 01:13:17 +0000 (01:13 +0000)
Gbp-Pq: Name 05_sparc_unaligned_access.diff

Source/WTF/wtf/ListHashSet.h

index 78639b4067c137d7df368d49fc128f59e89ad722..fe67f48be5ab33998aa23e70b464fdc696050d2e 100644 (file)
@@ -173,7 +173,7 @@ namespace WTF {
             : m_freeList(pool())
             , m_isDoneWithInitialFreeList(false)
         { 
-            memset(m_pool.pool, 0, sizeof(m_pool.pool));
+            memset(m_pool, 0, sizeof(m_pool));
         }
 
         Node* allocate()
@@ -217,7 +217,7 @@ namespace WTF {
         }
 
     private:
-        Node* pool() { return reinterpret_cast_ptr<Node*>(m_pool.pool); }
+        Node* pool() { return reinterpret_cast_ptr<Node*>(m_pool); }
         Node* pastPool() { return pool() + m_poolSize; }
         bool inPool(Node* node)
         {
@@ -227,10 +227,7 @@ namespace WTF {
         Node* m_freeList;
         bool m_isDoneWithInitialFreeList;
         static const size_t m_poolSize = inlineCapacity;
-        union {
-            char pool[sizeof(Node) * m_poolSize];
-            double forAlignment;
-        } m_pool;
+        uint32_t m_pool[(sizeof(Node) * m_poolSize + sizeof(uint32_t) - 1) / sizeof(uint32_t)];
     };
 
     template<typename ValueArg, size_t inlineCapacity> struct ListHashSetNode {