Skip to content

Commit

Permalink
NoNewGlobals for cache_mem_map (squid-cache#1781)
Browse files Browse the repository at this point in the history
Detected by Coverity. CID 1554648: Initialization or destruction
ordering is unspecified (GLOBAL_INIT_ORDER).
  • Loading branch information
kinkie committed Jun 22, 2024
1 parent 055d5b4 commit cd0df03
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/MemStore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit cd0df03

Please sign in to comment.