mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-29 03:36:07 +08:00
ignore cast-align in Pool allocation for Node
This commit is contained in:
committed by
Daniel Agar
parent
02c165fafd
commit
2cc6dcabed
@@ -138,6 +138,9 @@ public:
|
|||||||
template <std::size_t PoolSize, uint8_t BlockSize, typename RaiiSynchronizer>
|
template <std::size_t PoolSize, uint8_t BlockSize, typename RaiiSynchronizer>
|
||||||
const uint16_t PoolAllocator<PoolSize, BlockSize, RaiiSynchronizer>::NumBlocks;
|
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>
|
template <std::size_t PoolSize, uint8_t BlockSize, typename RaiiSynchronizer>
|
||||||
PoolAllocator<PoolSize, BlockSize, RaiiSynchronizer>::PoolAllocator() :
|
PoolAllocator<PoolSize, BlockSize, RaiiSynchronizer>::PoolAllocator() :
|
||||||
free_list_(reinterpret_cast<Node*>(pool_.bytes)),
|
free_list_(reinterpret_cast<Node*>(pool_.bytes)),
|
||||||
@@ -155,6 +158,7 @@ PoolAllocator<PoolSize, BlockSize, RaiiSynchronizer>::PoolAllocator() :
|
|||||||
}
|
}
|
||||||
free_list_[NumBlocks - 1].next = UAVCAN_NULLPTR;
|
free_list_[NumBlocks - 1].next = UAVCAN_NULLPTR;
|
||||||
}
|
}
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
template <std::size_t PoolSize, uint8_t BlockSize, typename RaiiSynchronizer>
|
template <std::size_t PoolSize, uint8_t BlockSize, typename RaiiSynchronizer>
|
||||||
void* PoolAllocator<PoolSize, BlockSize, RaiiSynchronizer>::allocate(std::size_t size)
|
void* PoolAllocator<PoolSize, BlockSize, RaiiSynchronizer>::allocate(std::size_t size)
|
||||||
|
|||||||
Reference in New Issue
Block a user