1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-12 14:53:49 +01:00

goodbye strdup

This commit is contained in:
J. Nick Koston
2025-10-07 21:43:35 -10:00
parent 328c1a8469
commit d9c3213ef6

View File

@@ -65,6 +65,9 @@ class MDNSComponent : public Component {
return this->dynamic_txt_values_.back().c_str(); return this->dynamic_txt_values_.back().c_str();
} }
/// Storage for runtime-generated TXT values (MAC address, user lambdas)
/// Pre-sized at compile time via MDNS_DYNAMIC_TXT_COUNT to avoid heap allocations.
/// Static/compile-time values (version, board, etc.) are stored directly in flash and don't use this.
StaticVector<std::string, MDNS_DYNAMIC_TXT_COUNT> dynamic_txt_values_; StaticVector<std::string, MDNS_DYNAMIC_TXT_COUNT> dynamic_txt_values_;
protected: protected: