Commit Graph
14074 Commits
Author SHA1 Message Date
J. Nick Koston 5d67d16810 Merge remote-tracking branch 'origin/callback-manager-no-vector' into callback-manager-no-vector 2026-03-27 16:50:59 -10:00
J. Nick Koston d25a70b830 Merge remote-tracking branch 'upstream/dev' into callback-manager-no-vector 2026-03-27 16:50:46 -10:00
J. Nick Koston fa2b14ef41 Guard against nullptr+0 UB in call() and fix assert bound
- Add early return when size_==0 to avoid nullptr+0 pointer
  arithmetic (UB per C++ standard, even though all ESPHome
  targets treat it as no-op)
- Fix debug assert: size < UINT16_MAX allows capacity up to 65535
2026-03-27 16:47:56 -10:00
J. Nick Koston 967ded5477 Add ESPHOME_ALWAYS_INLINE to call() to stabilize inlining across struct layout changes 2026-03-27 16:40:59 -10:00
J. Nick Koston 42fe39cfd9 Use pointer iteration in call() to avoid uint16_t movzx overhead on x86-64 2026-03-27 16:24:23 -10:00
J. Nick Koston 41f9ed7fda Add braces to satisfy clang-tidy readability-braces-around-statements 2026-03-27 16:21:07 -10:00
J. Nick Koston 3a3345ace4 Revert accidental FixedRingBuffer change — only CallbackManager should be affected 2026-03-27 16:03:06 -10:00
J. Nick Koston acef5ad5bb Fix off-by-one in debug assert: size + 1 must also fit in uint16_t 2026-03-27 15:59:01 -10:00
J. Nick Koston f48eff29c3 Fix ::operator new / delete[] mismatch — use ::operator delete to match 2026-03-27 15:54:40 -10:00
J. Nick Koston fe8e7c134c Add debug assert for uint16_t overflow in callback_manager_grow 2026-03-27 15:53:47 -10:00
J. Nick Koston 1bdf6402a2 Move grow path to helpers.cpp as non-template function
Since Callback is trivially copyable regardless of signature,
the grow logic is type-independent. Move it to a concrete
function in helpers.cpp using void*/memcpy, eliminating the
template definition from the header entirely.
2026-03-27 15:52:33 -10:00
J. Nick Koston 29b5b3eba1 Move CallbackManager growth path out-of-line
Split add_() into inline fast path (size check + store) and
noinline cold grow_() for the allocation/memcpy/delete path.
Prevents the cold growth code from bloating every call site.
2026-03-27 15:48:52 -10:00
J. Nick Koston 69d3f563d5 [core] Replace std::vector in CallbackManager with trivial-copy container
Replace std::vector<Callback<void(Ts...)>> with a minimal container
that exploits Callback's trivially-copyable nature. Since Callback is
just {fn_ptr, ctx_ptr}, reallocation is a plain __builtin_memcpy
instead of std::vector's exception-safe move/copy machinery.

Uses uint16_t for size/capacity (8 bytes on 32-bit vs 12 for
std::vector), and grows to exact size since callbacks are registered
during setup() and most instances have 0-1 callbacks.

Eliminates _M_realloc_insert/_M_default_append template instantiations
per callback signature type.
2026-03-27 15:43:36 -10:00
Jonathan Swoboda 47774fb644 [modbus_controller] Fix wrong enum in function_code_to_register (#15253) 2026-03-27 19:55:57 -04:00
Jonathan Swoboda 34410e92b7 [as5600] Remove dead angle/position sensor code (#15254) 2026-03-27 19:55:40 -04:00
Edward Firmoandpre-commit-ci-lite[bot] a99f051e19 [nextion] Replace queue name string literals with short Nextion-native identifiers (#15215)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2026-03-27 13:49:00 -10:00
Keith Burzinski f6c63c62e4 [tmp117] Code clean-up (#15260) 2026-03-27 17:59:26 -05:00
Jonathan Swoboda 76d75850a3 [sgp4x] Remove dead voc_baseline config option (#15250) 2026-03-27 17:35:12 -04:00
Jonathan Swoboda 68d9f657ad [bl0940] Fix energy reference default using wrong constant in legacy mode (#15249) 2026-03-27 21:32:37 +00:00
Jonathan Swoboda 24b8a95340 [pid] Remove unused PIDSimulator class (#15247) 2026-03-27 17:24:15 -04:00
Jonathan Swoboda d245b9f123 [sm2135] Fix copy-paste error in setup pin mode (#15248) 2026-03-27 17:24:03 -04:00
Edward Firmo a2dee21e8e [nextion] Replace std::deque queues with std::list (#15211) 2026-03-27 10:24:19 -10:00
dependabot[bot] 3016cd3636 Bump github/codeql-action from 4.34.1 to 4.35.1 (#15245)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-27 09:29:08 -10:00
Jonathan Swoboda 7532e1f957 [multiple] Fix uninitialized members and error constant types (#15235) 2026-03-27 14:58:41 -04:00
Jonathan Swoboda f0db0c1054 [esp32] Add ESP-IDF 5.5.4 and 6.0.0 version mappings (#15241) 2026-03-27 14:48:08 -04:00
Jonathan Swoboda 05c15f4241 [remote_base] Fix gobox uint64_t format specifier (#15237) 2026-03-27 08:44:40 -10:00
Jonathan Swoboda 951ad91cb2 [atm90e32] Fix phase angle precision loss and remove unused member (#15238) 2026-03-27 08:39:30 -10:00
Jonathan Swoboda 53bd57f3c2 [pid] Fix inverted debug log conditions and broken smoothing formula (#15240) 2026-03-27 08:37:54 -10:00
Jonathan Swoboda 4b9467cd0c [esp32_ble_client] Fix wrong union member in OPEN_EVT handler (#15236) 2026-03-27 08:37:33 -10:00
Jonathan Swoboda 0a607b9c93 [esp32_ble_server] Fix wrong union member in STOP_EVT handler (#15239) 2026-03-27 08:36:16 -10:00
Jonathan Swoboda 810c046cc6 [multiple] Fix misc hardware register bugs (#15208) 2026-03-27 14:25:38 -04:00
J. Nick Koston 5a8d6931a8 [factory_reset] Migrate FastBootTrigger to callback automation (#15232) 2026-03-27 08:24:35 -10:00
J. Nick Koston 0d67f91fac [rf_bridge] Migrate triggers to callback automation (#15231) 2026-03-27 08:24:25 -10:00
J. Nick Koston f9d41bd36a [modbus_controller] Migrate triggers to callback automation (#15230) 2026-03-27 08:24:15 -10:00
J. Nick Koston 39509265bc [haier] Migrate triggers to callback automation (#15229) 2026-03-27 08:24:03 -10:00
J. Nick Koston 2f3c21c7c1 [ezo] Migrate triggers to callback automation (#15228) 2026-03-27 08:23:50 -10:00
J. Nick Koston d77bf23c76 [nextion] Migrate triggers to callback automation (#15227) 2026-03-27 08:23:37 -10:00
J. Nick Koston f5cd1e5e76 [ld2450] Fix flaky integration test race condition (#15226) 2026-03-27 08:23:26 -10:00
J. Nick Koston a73c67e476 [ltr501] Migrate triggers to callback automation (#15225) 2026-03-27 08:23:17 -10:00
J. Nick Koston a95f9f41fb [ltr_als_ps] Migrate triggers to callback automation (#15224) 2026-03-27 08:22:58 -10:00
J. Nick Koston 6ffb5af60c [fingerprint_grow] Migrate triggers to callback automation (#15223) 2026-03-27 08:22:47 -10:00
J. Nick Koston a5416df615 [sim800l] Migrate triggers to callback automation (#15222) 2026-03-27 08:22:36 -10:00
J. Nick Koston 985477f2cf [pn7150][pn7160] Migrate triggers to callback automation (#15221) 2026-03-27 08:22:25 -10:00
J. Nick Koston a4a8fa3027 [pn532] Migrate PN532OnFinishedWriteTrigger to callback automation (#15220) 2026-03-27 08:22:14 -10:00
J. Nick Koston 623408bbfe [hlk_fm22x] Migrate triggers to callback automation (#15219) 2026-03-27 08:22:02 -10:00
J. Nick Koston 514df6c99a [dfplayer] Migrate FinishedPlaybackTrigger to callback automation (#15218) 2026-03-27 08:21:52 -10:00
J. Nick Koston 54283a2599 [rotary_encoder] Migrate triggers to callback automation (#15217) 2026-03-27 08:21:41 -10:00
J. Nick Koston 4493d2efb6 [online_image] Migrate triggers to callback automation (#15216) 2026-03-27 08:21:27 -10:00
J. Nick Koston 83b3187126 [rtttl] Migrate FinishedPlaybackTrigger to callback automation (#15202) 2026-03-27 08:21:16 -10:00
J. Nick KostonandClaude Opus 4.6 a2d452684a [ld2450] Migrate LD2450DataTrigger to callback automation (#15201)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 08:21:03 -10:00