From: Francesco Chemolli <5175948+kinkie@users.noreply.github.com> Date: Tue, 16 Apr 2024 02:48:26 +0000 (+0000) Subject: NoNewGlobals for cache_mem_map (#1781) X-Git-Tag: SQUID_7_0_1~140 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3a5e9c1959c01faa7bf6fc6f8e4b45619392711e;p=thirdparty%2Fsquid.git NoNewGlobals for cache_mem_map (#1781) Detected by Coverity. CID 1554648: Initialization or destruction ordering is unspecified (GLOBAL_INIT_ORDER). --- diff --git a/src/MemStore.cc b/src/MemStore.cc index d0b4cff7e4..3cbb8bc2d4 100644 --- a/src/MemStore.cc +++ b/src/MemStore.cc @@ -25,7 +25,7 @@ #include "tools.h" /// shared memory segment path to use for MemStore maps -static const SBuf MapLabel("cache_mem_map"); +static const auto MapLabel = "cache_mem_map"; /// shared memory segment path to use for the free slices index static const char *SpaceLabel = "cache_mem_space"; /// shared memory segment path to use for IDs of shared pages with slice data @@ -196,7 +196,7 @@ MemStore::init() extras = shm_old(Extras)(ExtrasLabel); Must(!map); - map = new MemStoreMap(MapLabel); + map = new MemStoreMap(SBuf(MapLabel)); map->cleaner = this; } @@ -1040,7 +1040,7 @@ MemStoreRr::create() Must(!spaceOwner); spaceOwner = shm_new(Ipc::Mem::PageStack)(SpaceLabel, spaceConfig); Must(!mapOwner); - mapOwner = MemStoreMap::Init(MapLabel, entryLimit); + mapOwner = MemStoreMap::Init(SBuf(MapLabel), entryLimit); Must(!extrasOwner); extrasOwner = shm_new(MemStoreMapExtras)(ExtrasLabel, entryLimit); }