use vector instead of dequeue for memory optimization

This commit is contained in:
proddy
2025-10-19 16:10:15 +02:00
parent 02b486ea80
commit 16f7a454db
2 changed files with 17 additions and 17 deletions

View File

@@ -29,22 +29,22 @@ static_assert(uuid::console::thread_safe, "uuid-console must be thread-safe");
namespace emsesp { namespace emsesp {
// Static member definitions // Static member definitions
std::deque<std::unique_ptr<EMSdevice>> EMSESP::emsdevices{}; std::vector<std::unique_ptr<EMSdevice>> EMSESP::emsdevices{};
std::vector<EMSESP::Device_record> EMSESP::device_library_; std::vector<EMSESP::Device_record> EMSESP::device_library_;
uuid::log::Logger EMSESP::logger_{F_(emsesp), uuid::log::Facility::KERN}; uuid::log::Logger EMSESP::logger_{F_(emsesp), uuid::log::Facility::KERN};
uint16_t EMSESP::watch_id_ = WATCH_ID_NONE; uint16_t EMSESP::watch_id_ = WATCH_ID_NONE;
uint8_t EMSESP::watch_ = 0; uint8_t EMSESP::watch_ = 0;
uint16_t EMSESP::read_id_ = WATCH_ID_NONE; uint16_t EMSESP::read_id_ = WATCH_ID_NONE;
bool EMSESP::read_next_ = false; bool EMSESP::read_next_ = false;
uint16_t EMSESP::publish_id_ = 0; uint16_t EMSESP::publish_id_ = 0;
uint16_t EMSESP::response_id_ = 0; uint16_t EMSESP::response_id_ = 0;
bool EMSESP::tap_water_active_ = false; bool EMSESP::tap_water_active_ = false;
uint8_t EMSESP::publish_all_idx_ = 0; uint8_t EMSESP::publish_all_idx_ = 0;
uint8_t EMSESP::unique_id_count_ = 0; uint8_t EMSESP::unique_id_count_ = 0;
bool EMSESP::trace_raw_ = false; bool EMSESP::trace_raw_ = false;
uint16_t EMSESP::wait_validate_ = 0; uint16_t EMSESP::wait_validate_ = 0;
bool EMSESP::wait_km_ = false; bool EMSESP::wait_km_ = false;
uint32_t EMSESP::last_fetch_ = 0; uint32_t EMSESP::last_fetch_ = 0;
AsyncWebServer webServer(80); AsyncWebServer webServer(80);

View File

@@ -222,7 +222,7 @@ class EMSESP {
static void scan_devices(); static void scan_devices();
static void clear_all_devices(); static void clear_all_devices();
static std::deque<std::unique_ptr<EMSdevice>> emsdevices; static std::vector<std::unique_ptr<EMSdevice>> emsdevices;
// services // services
static Mqtt mqtt_; static Mqtt mqtt_;