#include <limits>
/// shared memory segment path to use for Transients map
-static const SBuf MapLabel("transients_map");
+static const auto &
+MapLabel()
+{
+ static const auto label = new SBuf("transients_map");
+ return *label;
+}
Transients::Transients(): map(nullptr), locals(nullptr)
{
assert(entryLimit > 0);
Must(!map);
- map = new TransientsMap(MapLabel);
+ map = new TransientsMap(MapLabel());
map->cleaner = this;
map->disableHitValidation(); // Transients lacks slices to validate
return nullptr;
if (StoreEntry *oldE = locals->at(index)) {
- debugs(20, 5, "found " << *oldE << " at " << index << " in " << MapLabel);
+ debugs(20, 5, "found " << *oldE << " at " << index << " in " << MapLabel());
assert(oldE->mem_obj && oldE->mem_obj->xitTable.index == index);
return oldE;
}
- debugs(20, 3, "no entry at " << index << " in " << MapLabel);
+ debugs(20, 3, "no entry at " << index << " in " << MapLabel());
return nullptr;
}
return; // no SMP configured or a misconfiguration
Must(!mapOwner);
- mapOwner = TransientsMap::Init(MapLabel, entryLimit);
+ mapOwner = TransientsMap::Init(MapLabel(), entryLimit);
}
TransientsRr::~TransientsRr()