mirror of
https://github.com/esphome/esphome.git
synced 2026-03-01 02:14:19 -07:00
0ba752e9470633cb3dbd4fb8703a404b6031d1a0
Replace the global `Application App` with placement-new construction in aligned .bss storage. This eliminates the global constructor and destructor chain that were: - Calling xSemaphoreCreateMutex() at static init time (via Scheduler's Mutex member) before app_main() runs - Redundantly zero-initializing all members that .bss already zeroes - Registering __cxa_atexit for ~Application() destructor chain (~Application, ~vector, ~Mutex) that never runs on embedded The storage is a char[] with a GCC asm label matching the mangled name of esphome::App. Other translation units see a typed extern Application (identical codegen, no indirection), while the defining TU sees a trivially-destructible char array — so the compiler never emits __cxa_atexit or the destructor chain. Construction happens in pre_setup() via placement new, which is always the first method called on App in the generated setup() function.
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
524 MiB
Languages
C++
64.1%
Python
35.5%
C
0.3%
