Skip to content

Commit da5a51c

Browse files
mario-kruegerktf
authored andcommitted
DPL Analysis: issue fatal error if HistogramRegistry is full
1 parent 8c88cd5 commit da5a51c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Framework/Core/src/HistogramRegistry.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ HistPtr HistogramRegistry::insert(const HistogramSpec& histSpec)
7979
// helper function that checks if histogram name can be used in registry
8080
void HistogramRegistry::validateHistName(const std::string& name, const uint32_t hash)
8181
{
82+
// check that there are still slots left in the registry
83+
if (mRegisteredNames.size() == MAX_REGISTRY_SIZE) {
84+
LOGF(fatal, R"(HistogramRegistry "%s" is full! It can hold only %d histograms.)", mName, MAX_REGISTRY_SIZE);
85+
}
86+
8287
// validate that hash is unique
8388
auto it = std::find(mRegistryKey.begin(), mRegistryKey.end(), hash);
8489
if (it != mRegistryKey.end()) {

0 commit comments

Comments
 (0)