Allocator interface: getNumBlocks() --> getBlockCapacity()

This commit is contained in:
Pavel Kirienko
2015-10-16 14:31:42 +03:00
parent 913f6ea034
commit 660e84e17f
8 changed files with 43 additions and 22 deletions
+2 -2
View File
@@ -295,10 +295,10 @@ CanIOManager::CanIOManager(ICanDriver& driver, IPoolAllocator& allocator, ISyste
if (mem_blocks_per_iface == 0)
{
mem_blocks_per_iface = allocator.getNumBlocks() / (num_ifaces_ + 1U) + 1U;
mem_blocks_per_iface = allocator.getBlockCapacity() / (num_ifaces_ + 1U) + 1U;
}
UAVCAN_TRACE("CanIOManager", "Memory blocks per iface: %u, total: %u",
unsigned(mem_blocks_per_iface), unsigned(allocator.getNumBlocks()));
unsigned(mem_blocks_per_iface), unsigned(allocator.getBlockCapacity()));
for (int i = 0; i < num_ifaces_; i++)
{
+2 -2
View File
@@ -33,9 +33,9 @@ void LimitedPoolAllocator::deallocate(const void* ptr)
}
}
uint16_t LimitedPoolAllocator::getNumBlocks() const
uint16_t LimitedPoolAllocator::getBlockCapacity() const
{
return min(max_blocks_, allocator_.getNumBlocks());
return min(max_blocks_, allocator_.getBlockCapacity());
}
}