mirror of
https://github.com/esphome/esphome.git
synced 2026-09-15 00:58:40 +00:00
Merge remote-tracking branch 'origin/reduce-automation-call-stack' into integration
This commit is contained in:
@@ -324,7 +324,7 @@ template<typename... Ts> class Trigger {
|
||||
/// Inform the parent automation that the event has triggered.
|
||||
// Force-inline: collapses the Trigger→Automation→ActionList forwarding
|
||||
// chain into a single frame, reducing automation call stack depth.
|
||||
__attribute__((always_inline)) void trigger(const Ts &...x) {
|
||||
inline void trigger(const Ts &...x) ESPHOME_ALWAYS_INLINE {
|
||||
if (this->automation_parent_ == nullptr)
|
||||
return;
|
||||
this->automation_parent_->trigger(x...);
|
||||
@@ -433,7 +433,7 @@ template<typename... Ts> class ActionList {
|
||||
}
|
||||
// Force-inline: part of the Trigger→Automation→ActionList forwarding
|
||||
// chain collapsed to reduce automation call stack depth.
|
||||
__attribute__((always_inline)) void play(const Ts &...x) {
|
||||
inline void play(const Ts &...x) ESPHOME_ALWAYS_INLINE {
|
||||
if (this->actions_begin_ != nullptr)
|
||||
this->actions_begin_->play_complex(x...);
|
||||
}
|
||||
@@ -479,7 +479,7 @@ template<typename... Ts> class Automation {
|
||||
|
||||
// Force-inline: part of the Trigger→Automation→ActionList forwarding
|
||||
// chain collapsed to reduce automation call stack depth.
|
||||
__attribute__((always_inline)) void trigger(const Ts &...x) { this->actions_.play(x...); }
|
||||
inline void trigger(const Ts &...x) ESPHOME_ALWAYS_INLINE { this->actions_.play(x...); }
|
||||
|
||||
bool is_running() { return this->actions_.is_running(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user