Skip to content

Commit b2c8557

Browse files
authored
Update memory_types.hpp
Heap needs to call attach as well after memory increase
1 parent fa48536 commit b2c8557

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

rtb/datacache/memory_types.hpp

+8-11
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <boost/thread/locks.hpp>
2828
#include <boost/thread/shared_mutex.hpp>
2929

30-
namespace mpclmi { namespace ipc {
30+
namespace mpclmi::ipc {
3131

3232
struct Shared {
3333
typedef boost::interprocess::managed_shared_memory segment_t;
@@ -49,8 +49,7 @@ struct Shared {
4949
mem_ptr.reset() ;
5050
segment_t::grow(path.c_str(), size) ;
5151
mem_ptr.reset(open_segment(path)) ;
52-
return ;
53-
}
52+
}
5453
static std::string convert_base_dir([[maybe_unused]] const std::string &base_dir) {
5554
return "" ;
5655
}
@@ -81,8 +80,7 @@ struct Mapped {
8180
mem_ptr.reset() ;
8281
segment_t::grow(path.c_str(), size) ;
8382
mem_ptr.reset(open_segment(path)) ;
84-
return ;
85-
}
83+
}
8684
static std::string convert_base_dir(const std::string &base_dir) {
8785
return base_dir + "/";
8886
}
@@ -108,17 +106,16 @@ struct Heap {
108106
template <typename MemPtr>
109107
static void grow( MemPtr &mem_ptr, [[maybe_unused]] const std::string &path, size_t size) {
110108
mem_ptr->grow(size) ;
111-
return ;
112-
}
109+
}
113110
static std::string convert_base_dir([[maybe_unused]] const std::string &base_dir) {
114111
return "" ;
115112
}
116113

117114
template<typename Function>
118-
static void attach( Function && ) {}
115+
static void attach( Function && f) {
116+
f() ;
117+
}
119118
};
120119

121-
}}
120+
}
122121
#endif /* __IPC_MEMORY_TYPES_HPP__ */
123-
124-

0 commit comments

Comments
 (0)