From 067c9ad1faaeabd24306686983714c09e46c0828 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 16 Mar 2026 12:24:40 -1000 Subject: [PATCH] Force inline Entry::destroy for 16 bytes flash savings --- esphome/components/api/api_overflow_buffer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esphome/components/api/api_overflow_buffer.h b/esphome/components/api/api_overflow_buffer.h index bfd7acb0072..cd26bcdb8ba 100644 --- a/esphome/components/api/api_overflow_buffer.h +++ b/esphome/components/api/api_overflow_buffer.h @@ -7,6 +7,7 @@ #ifdef USE_API #include "esphome/components/socket/socket.h" +#include "esphome/core/helpers.h" namespace esphome::api { @@ -33,7 +34,7 @@ class APIOverflowBuffer { const uint8_t *current_data() const { return this->data + this->offset; } /// Free this entry and its data buffer. - static void destroy(Entry *entry) { + static ESPHOME_ALWAYS_INLINE void destroy(Entry *entry) { delete[] entry->data; delete entry; // NOLINT(cppcoreguidelines-owning-memory) }