From f69f6e297a34678de0e1f209d196dd7bef2a4273 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Wed, 18 Feb 2026 12:57:07 +0100 Subject: Added basic memory usage estimation --- lib/core/c++/memory.hpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lib/core/c++/memory.hpp') diff --git a/lib/core/c++/memory.hpp b/lib/core/c++/memory.hpp index b6a089e..e97c7fc 100644 --- a/lib/core/c++/memory.hpp +++ b/lib/core/c++/memory.hpp @@ -21,11 +21,31 @@ struct memory_size_helper> { static constexpr uint64_t bytes = saw::ct_multiply::value * memory_size_helper::bytes; }; +template +struct memory_size_helper> { + static constexpr uint64_t bytes = saw::ct_multiply::value * memory_size_helper::bytes; +}; + template struct memory_size_helper> { static constexpr uint64_t bytes = memory_size_helper::InnerSchema>::bytes; }; +template +struct memory_size_helper> { + + template + static constexpr uint64_t apply_i() { + if constexpr ( i < sizeof...(Members) ){ + using M_I = typename saw::parameter_pack_type::type; + return apply_i() + memory_size_helper::bytes; + } + return 0u; + } + + static constexpr uint64_t bytes = apply_i<0u>(); +}; + template class memory_estimate_helper final { private: -- cgit v1.2.3