Files
esphome/esphome/components/api
J. Nick Koston e9fee86c9d [logger] Replace LogListener virtual interface with LogCallback struct
Replace the LogListener abstract class (single pure virtual method) with
a lightweight LogCallback struct containing a function pointer + instance
pointer. This eliminates a vtable sub-table and thunk from every class
that previously inherited LogListener.

Savings per former LogListener implementer:
- 12 bytes vtable (sub-table header + thunk slot)
- 4 bytes vtable (on_log in primary table)
- ~23 bytes thunk code
- ~39 bytes total per class

Affected classes: APIServer, WebServer, MQTTClientComponent, Syslog,
BLENUS, LoggerMessageTrigger (6 classes, ~234 bytes total).

The non-capturing lambdas used at registration sites decay to plain
function pointers at compile time -- zero closure/std::function overhead.
2026-02-18 22:42:59 -06:00
..