Skip to content

Commit

Permalink
Merge pull request #44741 from Dr15Jones/fixPSetWriteMemory_13_2
Browse files Browse the repository at this point in the history
Fix memory use when writing ParameterSets to files [13_2]
  • Loading branch information
cmsbuild committed Apr 16, 2024
2 parents 3864710 + bdfd19d commit 85b53af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion FWCore/ParameterSet/src/ParameterSet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ namespace edm {
if (useAll || b->second.isTracked()) {
size += 2;
size += b->first.size();
size += sizeof(ParameterSetID) * b->second.vpset().size();
size += sizeof(ParameterSetID) * b->second.size();
}
}

Expand Down
4 changes: 3 additions & 1 deletion FWCore/ParameterSet/src/VParameterSetEntry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ namespace edm {
return theVPSet_->at(i);
}

std::vector<ParameterSet>::size_type VParameterSetEntry::size() const { return vpset().size(); }
std::vector<ParameterSet>::size_type VParameterSetEntry::size() const {
return theIDs_ ? theIDs_->size() : (theVPSet_ ? vpset().size() : 0);
}

void VParameterSetEntry::registerPsetsAndUpdateIDs() {
fillVPSet();
Expand Down

0 comments on commit 85b53af

Please sign in to comment.