mirror of
https://github.com/esphome/esphome.git
synced 2026-02-26 14:03:14 -07:00
60dc18b80cc8b5027e0c7bda67b90330cd0c4201
On BK7231N (Thumb-1/Cortex-M0), GCC inlines ~unique_ptr<SchedulerItem> (~30 bytes: null check + ~std::function + operator delete) at every destruction site, while ESP32/ESP8266/RTL8720CF outline it into a single shared helper. This causes significant flash bloat in scheduler functions. Use a custom deleter (SchedulerItemDeleter) with its operator() defined in the .cpp file, ensuring the compiler emits exactly one copy of the destruction code. All destruction sites now generate a simple function call instead of inlining the full body. BK7231N savings (bytes): - call(): 816 -> 670 (-146) - process_to_add(): 390 -> 308 (-82) - __adjust_heap: 430 -> 312 (-118) - pop_raw_locked_(): 192 -> 140 (-52) - cleanup_(): 130 -> 112 (-18) - SchedulerItemDeleter: +32 (new, single copy) - Net: ~384 bytes saved ESP32/ESP8266/RTL8720CF are unaffected (already outline the destructor).
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
496 MiB
Languages
C++
64.1%
Python
35.5%
C
0.3%
