ignore cast-align in Pool allocation for Node

This commit is contained in:
Siddharth Purohit 2021-06-26 13:16:56 +05:30 committed by Daniel Agar
parent 02c165fafd
commit 2cc6dcabed
No known key found for this signature in database
GPG Key ID: FD3CBA98017A69DE

View File

@ -138,6 +138,9 @@ public:
template <std::size_t PoolSize, uint8_t BlockSize, typename RaiiSynchronizer>
const uint16_t PoolAllocator<PoolSize, BlockSize, RaiiSynchronizer>::NumBlocks;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align"
template <std::size_t PoolSize, uint8_t BlockSize, typename RaiiSynchronizer>
PoolAllocator<PoolSize, BlockSize, RaiiSynchronizer>::PoolAllocator() :
free_list_(reinterpret_cast<Node*>(pool_.bytes)),
@ -155,6 +158,7 @@ PoolAllocator<PoolSize, BlockSize, RaiiSynchronizer>::PoolAllocator() :
}
free_list_[NumBlocks - 1].next = UAVCAN_NULLPTR;
}
#pragma GCC diagnostic pop
template <std::size_t PoolSize, uint8_t BlockSize, typename RaiiSynchronizer>
void* PoolAllocator<PoolSize, BlockSize, RaiiSynchronizer>::allocate(std::size_t size)