Skip to content

Commit

Permalink
Update memory_types.hpp
Browse files Browse the repository at this point in the history
Heap needs to call attach as well after memory increase
  • Loading branch information
cxx24 committed Jun 10, 2024
1 parent fa48536 commit b2c8557
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions rtb/datacache/memory_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <boost/thread/locks.hpp>
#include <boost/thread/shared_mutex.hpp>

namespace mpclmi { namespace ipc {
namespace mpclmi::ipc {

struct Shared {
typedef boost::interprocess::managed_shared_memory segment_t;
Expand All @@ -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 "" ;
}
Expand Down Expand Up @@ -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 + "/";
}
Expand All @@ -108,17 +106,16 @@ struct Heap {
template <typename MemPtr>
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<typename Function>
static void attach( Function && ) {}
static void attach( Function && f) {
f() ;
}
};

}}
}
#endif /* __IPC_MEMORY_TYPES_HPP__ */


0 comments on commit b2c8557

Please sign in to comment.