From b2c85577364dd0f03be05a22dc5b1511de119183 Mon Sep 17 00:00:00 2001 From: cxx23 <164133010+cxx24@users.noreply.github.com> Date: Mon, 10 Jun 2024 15:22:40 -0700 Subject: [PATCH] Update memory_types.hpp Heap needs to call attach as well after memory increase --- rtb/datacache/memory_types.hpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/rtb/datacache/memory_types.hpp b/rtb/datacache/memory_types.hpp index f74d408..8b62727 100644 --- a/rtb/datacache/memory_types.hpp +++ b/rtb/datacache/memory_types.hpp @@ -27,7 +27,7 @@ #include #include -namespace mpclmi { namespace ipc { +namespace mpclmi::ipc { struct Shared { typedef boost::interprocess::managed_shared_memory segment_t; @@ -49,8 +49,7 @@ struct Shared { mem_ptr.reset() ; segment_t::grow(path.c_str(), size) ; mem_ptr.reset(open_segment(path)) ; - return ; - } + } static std::string convert_base_dir([[maybe_unused]] const std::string &base_dir) { return "" ; } @@ -81,8 +80,7 @@ struct Mapped { mem_ptr.reset() ; segment_t::grow(path.c_str(), size) ; mem_ptr.reset(open_segment(path)) ; - return ; - } + } static std::string convert_base_dir(const std::string &base_dir) { return base_dir + "/"; } @@ -108,17 +106,16 @@ struct Heap { template static void grow( MemPtr &mem_ptr, [[maybe_unused]] const std::string &path, size_t size) { mem_ptr->grow(size) ; - return ; - } + } static std::string convert_base_dir([[maybe_unused]] const std::string &base_dir) { return "" ; } template - static void attach( Function && ) {} + static void attach( Function && f) { + f() ; + } }; -}} +} #endif /* __IPC_MEMORY_TYPES_HPP__ */ - -