From 9a432c03231781403f2a4808846183623cbfc49e Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Fri, 16 Oct 2015 20:36:56 +0300 Subject: [PATCH] Heap based allocator - peak usage removed --- .../uavcan/helpers/heap_based_pool_allocator.hpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/libuavcan/include/uavcan/helpers/heap_based_pool_allocator.hpp b/libuavcan/include/uavcan/helpers/heap_based_pool_allocator.hpp index dd2c9c8331..f2e9e9e0d6 100644 --- a/libuavcan/include/uavcan/helpers/heap_based_pool_allocator.hpp +++ b/libuavcan/include/uavcan/helpers/heap_based_pool_allocator.hpp @@ -54,7 +54,6 @@ class UAVCAN_EXPORT HeapBasedPoolAllocator : public IPoolAllocator, uint16_t num_reserved_blocks_; uint16_t num_allocated_blocks_; - uint16_t peak_allocated_blocks_; Node* reserve_; @@ -76,7 +75,6 @@ public: static_cast(NumericTraits::max())))), num_reserved_blocks_(0), num_allocated_blocks_(0), - peak_allocated_blocks_(0), reserve_(NULL) { } @@ -116,11 +114,6 @@ public: { reserve_ = reserve_->next; num_allocated_blocks_++; - - if (UAVCAN_UNLIKELY(num_allocated_blocks_ > peak_allocated_blocks_)) - { - peak_allocated_blocks_ = num_allocated_blocks_; - } return p; } @@ -139,10 +132,6 @@ public: num_reserved_blocks_++; num_allocated_blocks_++; - if (num_allocated_blocks_ > peak_allocated_blocks_) - { - peak_allocated_blocks_ = num_allocated_blocks_; - } } return m; }