Files
esphome/esphome
J. Nick Koston d4d8e92243 [bme68x_bsec2] Store trigger time as member to avoid SBO overflow
The set_timeout lambda captured [this, curr_time_ns] (4 + 8 = 12
bytes), exceeding the std::function small buffer optimization
threshold (8 bytes on 32-bit) and forcing a heap allocation every
measurement cycle (every 3s in LP mode).

Store curr_time_ns as a class member and capture only [this] (4
bytes), which fits inline in the SBO. Trades 8 bytes of permanent
member storage to eliminate a heap alloc+free cycle per measurement.
2026-03-19 00:22:31 -10:00
..