mirror of
https://github.com/esphome/esphome.git
synced 2026-02-28 09:54:19 -07:00
[core] Shrink Application::dump_config_at_ from size_t to uint16_t
Components are indexed by ESPHOME_COMPONENT_COUNT which is a uint16_t-sized StaticVector. Using size_t for the dump_config index wastes 2 bytes of storage and adds padding. Move it to the uint16_t group for better struct packing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -582,9 +582,6 @@ class Application {
|
||||
std::string name_;
|
||||
std::string friendly_name_;
|
||||
|
||||
// size_t members
|
||||
size_t dump_config_at_{SIZE_MAX};
|
||||
|
||||
// 4-byte members
|
||||
uint32_t last_loop_{0};
|
||||
uint32_t loop_component_start_time_{0};
|
||||
@@ -594,7 +591,8 @@ class Application {
|
||||
#endif
|
||||
|
||||
// 2-byte members (grouped together for alignment)
|
||||
uint16_t loop_interval_{16}; // Loop interval in ms (max 65535ms = 65.5 seconds)
|
||||
uint16_t dump_config_at_{std::numeric_limits<uint16_t>::max()}; // Index into components_ for dump_config progress
|
||||
uint16_t loop_interval_{16}; // Loop interval in ms (max 65535ms = 65.5 seconds)
|
||||
uint16_t looping_components_active_end_{0}; // Index marking end of active components in looping_components_
|
||||
uint16_t current_loop_index_{0}; // For safe reentrant modifications during iteration
|
||||
|
||||
|
||||
Reference in New Issue
Block a user