|
SuperTinyKernel™ RTOS 1.08.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
Snapshot of the memory allocator's statistics. More...
#include <stk_memory_allocator.h>
Public Member Functions | |
| Stats (size_t capacity_=0U) | |
| void | Reset (size_t capacity_) |
| Restart the statistics for a pool of the given capacity. | |
| size_t | GetCapacity () const |
| Get total capacity of the memory pool. | |
| size_t | GetAvailable () const |
| Get number of bytes currently available for allocation. | |
| void | RecordAllocate (size_t size) |
| Record successful allocation. | |
| void | RecordFree (size_t size) |
| Record successful deallocation. | |
| void | RecordAllocFail () |
| Record failed allocation request. | |
Public Attributes | |
| size_t | capacity |
| Total capacity of the memory pool in bytes. | |
| volatile size_t | allocated |
| Number of bytes currently allocated (dynamic value). | |
| volatile size_t | peak_allocated |
| Maximum number of bytes that were allocated at the same time (high watermark). | |
| volatile size_t | allocate_count |
| Number of successful allocations with Allocate(). | |
| volatile size_t | free_count |
| Number of successful frees with Free(). | |
| volatile size_t | alloc_fail_count |
| Number of allocation requests that could not be satisfied. | |
| volatile size_t | min_ever_free |
| Minimum free bytes recorded since system start (watermark). | |
Snapshot of the memory allocator's statistics.
Definition at line 206 of file stk_memory_allocator.h.
|
inline |
Definition at line 208 of file stk_memory_allocator.h.
References alloc_fail_count, allocate_count, allocated, capacity, free_count, min_ever_free, and peak_allocated.
|
inline |
Get number of bytes currently available for allocation.
Definition at line 245 of file stk_memory_allocator.h.
References allocated, and capacity.
Referenced by RecordAllocate(), vPortGetHeapStats(), and xPortGetFreeHeapSize().
|
inline |
Get total capacity of the memory pool.
Definition at line 240 of file stk_memory_allocator.h.
References capacity.
|
inline |
Record successful allocation.
| [in] | size | Size of allocated memory chunk. |
Definition at line 254 of file stk_memory_allocator.h.
References allocate_count, allocated, GetAvailable(), min_ever_free, and peak_allocated.
|
inline |
Record failed allocation request.
Definition at line 288 of file stk_memory_allocator.h.
References alloc_fail_count.
|
inline |
Record successful deallocation.
| [in] | size | Size of freed memory chunk. |
Definition at line 276 of file stk_memory_allocator.h.
References allocated, free_count, and STK_ASSERT.
|
inline |
Restart the statistics for a pool of the given capacity.
Clears all counters and watermarks. Used by pools that learn their real capacity only after aligning/trimming their storage.
| [in] | capacity_ | Total capacity in bytes. |
Definition at line 226 of file stk_memory_allocator.h.
References alloc_fail_count, allocate_count, allocated, capacity, free_count, min_ever_free, and peak_allocated.
| volatile size_t stk::memory::MemoryAllocator::Stats::alloc_fail_count |
Number of allocation requests that could not be satisfied.
Definition at line 218 of file stk_memory_allocator.h.
Referenced by RecordAllocFail(), Reset(), and Stats().
| volatile size_t stk::memory::MemoryAllocator::Stats::allocate_count |
Number of successful allocations with Allocate().
Definition at line 216 of file stk_memory_allocator.h.
Referenced by RecordAllocate(), Reset(), Stats(), and vPortGetHeapStats().
| volatile size_t stk::memory::MemoryAllocator::Stats::allocated |
Number of bytes currently allocated (dynamic value).
Definition at line 214 of file stk_memory_allocator.h.
Referenced by GetAvailable(), RecordAllocate(), RecordFree(), Reset(), and Stats().
| size_t stk::memory::MemoryAllocator::Stats::capacity |
Total capacity of the memory pool in bytes.
Definition at line 213 of file stk_memory_allocator.h.
Referenced by GetAvailable(), GetCapacity(), Reset(), and Stats().
| volatile size_t stk::memory::MemoryAllocator::Stats::free_count |
Number of successful frees with Free().
Definition at line 217 of file stk_memory_allocator.h.
Referenced by RecordFree(), Reset(), Stats(), and vPortGetHeapStats().
| volatile size_t stk::memory::MemoryAllocator::Stats::min_ever_free |
Minimum free bytes recorded since system start (watermark).
Definition at line 219 of file stk_memory_allocator.h.
Referenced by RecordAllocate(), Reset(), Stats(), vPortGetHeapStats(), and xPortGetMinimumEverFreeHeapSize().
| volatile size_t stk::memory::MemoryAllocator::Stats::peak_allocated |
Maximum number of bytes that were allocated at the same time (high watermark).
Definition at line 215 of file stk_memory_allocator.h.
Referenced by RecordAllocate(), Reset(), and Stats().