1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-28 08:02:23 +01:00
This commit is contained in:
J. Nick Koston
2025-09-02 19:39:49 -05:00
parent 6e14050351
commit be4c8956ad

View File

@@ -127,13 +127,13 @@ void HOT Scheduler::set_timer_common_(Component *component, SchedulerItem::Type
item = std::move(this->scheduler_item_pool_.back()); item = std::move(this->scheduler_item_pool_.back());
this->scheduler_item_pool_.pop_back(); this->scheduler_item_pool_.pop_back();
#ifdef ESPHOME_DEBUG_SCHEDULER #ifdef ESPHOME_DEBUG_SCHEDULER
ESP_LOGVV(TAG, "Reused item from pool (pool size now: %zu)", this->scheduler_item_pool_.size()); ESP_LOGD(TAG, "Reused item from pool (pool size now: %zu)", this->scheduler_item_pool_.size());
#endif #endif
} else { } else {
// Allocate new if pool is empty // Allocate new if pool is empty
item = make_unique<SchedulerItem>(); item = make_unique<SchedulerItem>();
#ifdef ESPHOME_DEBUG_SCHEDULER #ifdef ESPHOME_DEBUG_SCHEDULER
ESP_LOGVV(TAG, "Allocated new item (pool empty)"); ESP_LOGD(TAG, "Allocated new item (pool empty)");
#endif #endif
} }
item->component = component; item->component = component;
@@ -819,11 +819,11 @@ void Scheduler::recycle_item_(std::unique_ptr<SchedulerItem> item) {
item->clear_dynamic_name(); item->clear_dynamic_name();
this->scheduler_item_pool_.push_back(std::move(item)); this->scheduler_item_pool_.push_back(std::move(item));
#ifdef ESPHOME_DEBUG_SCHEDULER #ifdef ESPHOME_DEBUG_SCHEDULER
ESP_LOGVV(TAG, "Recycled item to pool (pool size now: %zu)", this->scheduler_item_pool_.size()); ESP_LOGD(TAG, "Recycled item to pool (pool size now: %zu)", this->scheduler_item_pool_.size());
#endif #endif
} else { } else {
#ifdef ESPHOME_DEBUG_SCHEDULER #ifdef ESPHOME_DEBUG_SCHEDULER
ESP_LOGVV(TAG, "Pool full (size: %zu), deleting item", this->scheduler_item_pool_.size()); ESP_LOGD(TAG, "Pool full (size: %zu), deleting item", this->scheduler_item_pool_.size());
#endif #endif
} }
// else: unique_ptr will delete the item when it goes out of scope // else: unique_ptr will delete the item when it goes out of scope