Commit Graph
26349 Commits
Author SHA1 Message Date
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 a360e43ee8 Fix MapFilter: use init_array_from (missed in merge) 2026-03-27 16:18:21 -10:00
J. Nick Koston 1b52a2f2b9 Merge remote-tracking branch 'upstream/text_sensor_substitute_static_array' into integration 2026-03-27 16:16:59 -10:00
J. Nick Koston 674cdd8be4 Merge remote-tracking branch 'upstream/binary_sensor_multiclick_static_array' into integration 2026-03-27 16:16:59 -10:00
J. Nick Koston 507500171f Merge remote-tracking branch 'upstream/binary_sensor_autorepeat_static_array' into integration 2026-03-27 16:16:59 -10:00
J. Nick Koston b4537fbd55 Merge remote-tracking branch 'upstream/sensor_calibrate_polynomial_static_array' into integration 2026-03-27 16:16:58 -10:00
J. Nick Koston 74471296d5 Merge remote-tracking branch 'upstream/sensor_calibrate_linear_static_array' into integration 2026-03-27 16:16:58 -10:00
J. Nick Koston 3e97425dce Merge remote-tracking branch 'upstream/sensor_or_filter_static_array' into integration 2026-03-27 16:16:58 -10:00
J. Nick Koston 23cbee808a Merge remote-tracking branch 'upstream/sensor_value_list_static_array' into integration 2026-03-27 16:16:58 -10:00
J. Nick Koston 7f5409214b Use init_array_from helper for optimal codegen
Uses memcpy for trivially copyable types, element-wise copy otherwise.
ESPHOME_DEBUG_ASSERT catches size mismatches in integration tests.
2026-03-27 16:14:59 -10:00
J. Nick Koston c4aed6f7e5 Use init_array_from helper for optimal codegen
Uses memcpy for trivially copyable types, element-wise copy otherwise.
ESPHOME_DEBUG_ASSERT catches size mismatches in integration tests.
2026-03-27 16:14:57 -10:00
J. Nick Koston a20b0a96b9 Use init_array_from helper for optimal codegen
Uses memcpy for trivially copyable types, element-wise copy otherwise.
ESPHOME_DEBUG_ASSERT catches size mismatches in integration tests.
2026-03-27 16:14:55 -10:00
J. Nick Koston 8b42629e3e Use init_array_from helper for optimal codegen
Uses memcpy for trivially copyable types, element-wise copy otherwise.
ESPHOME_DEBUG_ASSERT catches size mismatches in integration tests.
2026-03-27 16:14:53 -10:00
J. Nick Koston ae2a82edd6 Use init_array_from helper for optimal codegen
Uses memcpy for trivially copyable types, element-wise copy otherwise.
ESPHOME_DEBUG_ASSERT catches size mismatches in integration tests.
2026-03-27 16:14:51 -10:00
J. Nick Koston f8e144b23b Use init_array_from helper for optimal codegen
Uses memcpy for trivially copyable types, element-wise copy otherwise.
ESPHOME_DEBUG_ASSERT catches size mismatches in integration tests.
2026-03-27 16:14:49 -10:00
J. Nick Koston 1d2f11b990 Use init_array_from helper for optimal codegen
Uses memcpy for trivially copyable types, element-wise copy otherwise.
ESPHOME_DEBUG_ASSERT catches size mismatches in integration tests.
2026-03-27 16:14:47 -10:00
J. Nick Koston 494d431bf8 Use init_array_from helper for optimal codegen
Uses memcpy for trivially copyable types, element-wise copy otherwise.
ESPHOME_DEBUG_ASSERT catches size mismatches in integration tests.
2026-03-27 16:14:45 -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 c2c34d39e7 [text_sensor] Assert size before writing, not after 2026-03-27 15:55:56 -10:00
J. Nick Koston 787af59845 [text_sensor] Assert size before writing, not after 2026-03-27 15:55:29 -10:00
J. Nick Koston 3e7dcc6490 [binary_sensor] Assert size before writing, not after 2026-03-27 15:54:44 -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 f9c2d60b7d [binary_sensor] Assert size before writing, not after 2026-03-27 15:54:12 -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 55963a6ea0 [sensor] Assert size before writing, not after 2026-03-27 15:53:18 -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 4cb1164a01 [sensor] Assert size before writing, not after 2026-03-27 15:52:16 -10:00
J. Nick Koston 3d68920de0 [sensor] Assert size before writing, not after 2026-03-27 15:51:05 -10:00
J. Nick Koston 70a9c2f8b6 [sensor] Assert size before writing, not after 2026-03-27 15:49:57 -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 a28f331f73 [text_sensor] Replace truncation guard with ESPHOME_DEBUG_ASSERT 2026-03-27 15:48:10 -10:00
J. Nick Koston f47799a645 [text_sensor] Replace truncation guard with ESPHOME_DEBUG_ASSERT 2026-03-27 15:48:09 -10:00
J. Nick Koston 869bafe338 [binary_sensor] Replace truncation guard with ESPHOME_DEBUG_ASSERT 2026-03-27 15:48:07 -10:00
J. Nick Koston f8138eef77 [binary_sensor] Replace truncation guard with ESPHOME_DEBUG_ASSERT 2026-03-27 15:48:07 -10:00
J. Nick Koston aae1edda0d [sensor] Replace truncation guard with ESPHOME_DEBUG_ASSERT 2026-03-27 15:48:06 -10:00
J. Nick Koston f162c5acd3 [sensor] Replace truncation guard with ESPHOME_DEBUG_ASSERT 2026-03-27 15:48:05 -10:00
J. Nick Koston 8a93b0c1c0 [sensor] Replace truncation guard with ESPHOME_DEBUG_ASSERT 2026-03-27 15:48:04 -10:00
J. Nick Koston c8609af6ce [sensor] Replace truncation guard with ESPHOME_DEBUG_ASSERT 2026-03-27 15:47:56 -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
J. Nick Koston f1221602f4 [binary_sensor] Move deleted copy/move to public (clang-tidy modernize-use-equals-delete) 2026-03-27 15:26:24 -10:00
J. Nick Koston cef546c8d8 [binary_sensor] Move deleted copy/move to public (clang-tidy modernize-use-equals-delete) 2026-03-27 15:26:03 -10:00
J. Nick Koston 2f1434c027 Merge remote-tracking branch 'upstream/text_sensor_map_static_array' into integration 2026-03-27 15:18:18 -10:00
J. Nick Koston 5997556586 Merge remote-tracking branch 'upstream/text_sensor_substitute_static_array' into integration 2026-03-27 15:18:18 -10:00
J. Nick Koston 755a9d3bd5 Merge remote-tracking branch 'upstream/binary_sensor_multiclick_static_array' into integration 2026-03-27 15:18:18 -10:00
J. Nick Koston ed352222d2 Merge remote-tracking branch 'upstream/binary_sensor_autorepeat_static_array' into integration 2026-03-27 15:18:18 -10:00
J. Nick Koston 910b910b0b Merge remote-tracking branch 'upstream/sensor_calibrate_polynomial_static_array' into integration 2026-03-27 15:18:08 -10:00
J. Nick Koston 3617435fd7 Merge remote-tracking branch 'upstream/sensor_calibrate_linear_static_array' into integration 2026-03-27 15:18:08 -10:00
J. Nick Koston 8942bbb43f Merge remote-tracking branch 'upstream/sensor_or_filter_static_array' into integration 2026-03-27 15:18:08 -10:00
J. Nick Koston 8066cc440a Merge remote-tracking branch 'upstream/sensor_value_list_static_array' into integration 2026-03-27 15:18:08 -10:00