1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-23 05:32:22 +01:00

[core] Convert entity vectors to static allocation for reduced memory usage (#10018)

This commit is contained in:
J. Nick Koston
2025-08-01 20:26:22 -10:00
committed by GitHub
parent 00d9baed11
commit 4f58e1c8b9
6 changed files with 118 additions and 124 deletions

View File

@@ -421,8 +421,10 @@ async def _add_automations(config):
@coroutine_with_priority(-100.0)
async def _add_platform_reserves() -> None:
# Generate compile-time entity count defines for static_entity_vector
for platform_name, count in sorted(CORE.platform_counts.items()):
cg.add(cg.RawStatement(f"App.reserve_{platform_name}({count});"), prepend=True)
define_name = f"ESPHOME_ENTITY_{platform_name.upper()}_COUNT"
cg.add_define(define_name, count)
@coroutine_with_priority(100.0)