From 1f5249de6f7e81aa6ff2586e386f526676e67c81 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 17 Jan 2024 15:31:23 +1100 Subject: shift some long-lived allocs into spi ram --- src/lua/include/property.hpp | 4 ++-- src/lua/property.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/lua') diff --git a/src/lua/include/property.hpp b/src/lua/include/property.hpp index 9c5129ae..425cc15c 100644 --- a/src/lua/include/property.hpp +++ b/src/lua/include/property.hpp @@ -48,7 +48,7 @@ class Property { private: LuaValue value_; std::optional> cb_; - std::vector> bindings_; + std::pmr::vector> bindings_; }; class PropertyBindings { @@ -61,7 +61,7 @@ class PropertyBindings { auto GetFunction(size_t i) -> const LuaFunction&; private: - std::vector functions_; + std::pmr::vector functions_; }; } // namespace lua diff --git a/src/lua/property.cpp b/src/lua/property.cpp index 2d702447..14056af7 100644 --- a/src/lua/property.cpp +++ b/src/lua/property.cpp @@ -17,6 +17,7 @@ #include "lua.hpp" #include "lua_thread.hpp" #include "lvgl.h" +#include "memory_resource.hpp" #include "service_locator.hpp" #include "track.hpp" #include "types.hpp" @@ -158,11 +159,12 @@ auto PropertyBindings::GetFunction(size_t i) -> const LuaFunction& { template inline constexpr bool always_false_v = false; -Property::Property(const LuaValue& val) : value_(val), cb_() {} +Property::Property(const LuaValue& val) + : value_(val), cb_(), bindings_(&memory::kSpiRamResource) {} Property::Property(const LuaValue& val, std::function cb) - : value_(val), cb_(cb) {} + : value_(val), cb_(cb), bindings_(&memory::kSpiRamResource) {} static auto pushTagValue(lua_State* L, const database::TagValue& val) -> void { std::visit( -- cgit v1.2.3