uavcan start enforcing code style (#7856)

This commit is contained in:
Daniel Agar
2017-08-25 13:07:21 -04:00
committed by GitHub
parent de6a552b53
commit edea4a369e
12 changed files with 284 additions and 153 deletions
+6 -9
View File
@@ -45,14 +45,12 @@
namespace uavcan_node
{
struct AllocatorSynchronizer
{
struct AllocatorSynchronizer {
const ::irqstate_t state = ::enter_critical_section();
~AllocatorSynchronizer() { ::leave_critical_section(state); }
};
struct Allocator : public uavcan::HeapBasedPoolAllocator<uavcan::MemPoolBlockSize, AllocatorSynchronizer>
{
struct Allocator : public uavcan::HeapBasedPoolAllocator<uavcan::MemPoolBlockSize, AllocatorSynchronizer> {
static constexpr unsigned CapacitySoftLimit = 250;
static constexpr unsigned CapacityHardLimit = 500;
@@ -62,11 +60,10 @@ struct Allocator : public uavcan::HeapBasedPoolAllocator<uavcan::MemPoolBlockSiz
~Allocator()
{
if (getNumAllocatedBlocks() > 0)
{
warnx("UAVCAN LEAKS MEMORY: %u BLOCKS (%u BYTES) LOST",
getNumAllocatedBlocks(), getNumAllocatedBlocks() * uavcan::MemPoolBlockSize);
}
if (getNumAllocatedBlocks() > 0) {
warnx("UAVCAN LEAKS MEMORY: %u BLOCKS (%u BYTES) LOST",
getNumAllocatedBlocks(), getNumAllocatedBlocks() * uavcan::MemPoolBlockSize);
}
}
};