Skip to content

Commit

Permalink
shm: UnmanagedRegion::MakeSegmentName()
Browse files Browse the repository at this point in the history
  • Loading branch information
rbx committed Sep 28, 2023
1 parent cfdf113 commit a15ee5f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions fairmq/shmem/UnmanagedRegion.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ struct UnmanagedRegion
, fRemoveOnDestruction(cfg.removeOnDestruction)
, fLinger(cfg.linger)
, fStopAcks(false)
, fName("fmq_" + shmId + "_rg_" + std::to_string(cfg.id.value()))
, fQueueName("fmq_" + shmId + "_rgq_" + std::to_string(cfg.id.value()))
, fRefCountSegmentName("fmq_" + shmId + "_rrc_" + std::to_string(cfg.id.value()))
, fName(MakeSegmentName(shmId, "rg", cfg.id.value()))
, fQueueName(MakeSegmentName(shmId, "rgq", cfg.id.value()))
, fRefCountSegmentName(MakeSegmentName(shmId, "rrc", cfg.id.value()))
, fShmemObject()
, fFile(nullptr)
, fFileMapping()
Expand Down Expand Up @@ -277,6 +277,10 @@ struct UnmanagedRegion
RegionCallback fCallback;
RegionBulkCallback fBulkCallback;

static std::string MakeSegmentName(const std::string& shmId, std::string_view segment, int regionIndex) {
return tools::ToString("fmq_", shmId, "_", segment, "_", regionIndex);
}

static RegionConfig makeRegionConfig(uint16_t id)
{
RegionConfig regionCfg;
Expand Down

0 comments on commit a15ee5f

Please sign in to comment.