pool: avoid alignment warnings on ARM
This commit is contained in:
parent
98dc992473
commit
ee53f8234b
2
pool.hpp
2
pool.hpp
@ -29,7 +29,7 @@ namespace util {
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
class pool : public nocopy {
|
class pool : public nocopy {
|
||||||
protected:
|
protected:
|
||||||
union node {
|
union alignas (T) node {
|
||||||
node *_node;
|
node *_node;
|
||||||
char _data[sizeof (T)];
|
char _data[sizeof (T)];
|
||||||
};
|
};
|
||||||
|
2
pool.ipp
2
pool.ipp
@ -98,7 +98,7 @@ namespace util {
|
|||||||
// save what will become the next node shortly. it could be overwritten
|
// save what will become the next node shortly. it could be overwritten
|
||||||
// in the constructor we're about to call.
|
// in the constructor we're about to call.
|
||||||
node *newnext = m_next->_node;
|
node *newnext = m_next->_node;
|
||||||
T *data = reinterpret_cast<T*> (m_next->_data);
|
T *data = reinterpret_cast<T*> (m_next);
|
||||||
|
|
||||||
// try to construct the returnable object.
|
// try to construct the returnable object.
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user