Static memory pool allocation (#7966)

* Static memory pool

* Initializer

* T-Lora Pager: Support LR1121 and SX1280 models (#7956)

* T-Lora Pager: Support LR1121 and SX1280 models

* Remove ifdefs

---------

Co-authored-by: WillyJL <me@willyjl.dev>
This commit is contained in:
Ben Meadors
2025-09-13 07:01:07 -05:00
committed by GitHub
parent 70ac3601b0
commit 9211b1bb4b
4 changed files with 19 additions and 14 deletions

View File

@@ -115,12 +115,11 @@ template <class T, int MaxSize> class MemoryPool : public Allocator<T>
bool used[MaxSize];
public:
MemoryPool()
MemoryPool() : pool{}, used{}
{
// Initialize the used array to false (all slots free)
for (int i = 0; i < MaxSize; i++) {
used[i] = false;
}
// Arrays are now zero-initialized by member initializer list
// pool array: all elements are default-constructed (zero for POD types)
// used array: all elements are false (zero-initialized)
}
/// Return a buffer for use by others