Shm: Use MakeShmName to construct shm object names

This commit is contained in:
Alexey Rybalchenko
2023-09-28 14:53:36 +02:00
parent 4310d07ed1
commit 8d28824489
5 changed files with 51 additions and 55 deletions

View File

@@ -44,8 +44,12 @@ using RBTreeBestFitSegment = boost::interprocess::basic_managed_shared_memory<ch
boost::interprocess::null_index>;
// boost::interprocess::iset_index>;
inline std::string MakeShmName(const std::string& shmId, const std::string& type) {
return std::string("fmq_" + shmId + "_" + type);
}
inline std::string MakeShmName(const std::string& shmId, const std::string& type, int index) {
return std::string("fmq_" + shmId + "_" + type + "_" + std::to_string(index));
return std::string(MakeShmName(shmId, type) + "_" + std::to_string(index));
}
struct RefCount