Merge branch 'extract_helpers' into integration

This commit is contained in:
J. Nick Koston
2025-06-27 12:56:28 -05:00
2 changed files with 8 additions and 1 deletions

View File

@@ -18,8 +18,12 @@ template<class T, uint8_t SIZE> class EventPool {
~EventPool() { ~EventPool() {
// Clean up any remaining events in the free list // Clean up any remaining events in the free list
T *event; T *event;
RAMAllocator<T> allocator(RAMAllocator<T>::ALLOC_INTERNAL);
while ((event = this->free_list_.pop()) != nullptr) { while ((event = this->free_list_.pop()) != nullptr) {
delete event; // Call destructor
event->~T();
// Deallocate using RAMAllocator
allocator.deallocate(event, 1);
} }
} }

View File

@@ -94,6 +94,9 @@ template<class T, uint8_t SIZE> class LockFreeQueue {
return next_tail == head_.load(std::memory_order_acquire); return next_tail == head_.load(std::memory_order_acquire);
} }
// Set the FreeRTOS task handle to notify when items are pushed to the queue
// This enables efficient wake-up of a consumer task that's waiting for data
// @param task The FreeRTOS task handle to notify, or nullptr to disable notifications
void set_task_to_notify(TaskHandle_t task) { task_to_notify_ = task; } void set_task_to_notify(TaskHandle_t task) { task_to_notify_ = task; }
protected: protected: