forked from OSchip/llvm-project
Don't create a temporary DenseMap for each input .eh_frame.
These maps are small, but we are creating an destroying one for each input .eh_frame. This patch reduces the total memory allocation from 765.54MB to 749.19MB. The peak is still the same: 563.7MB. llvm-svn: 331075
This commit is contained in:
parent
a05e8d3e68
commit
bd4d2acb11
|
|
@ -425,7 +425,7 @@ bool EhFrameSection::isFdeLive(EhSectionPiece &Fde, ArrayRef<RelTy> Rels) {
|
||||||
// one and associates FDEs to the CIE.
|
// one and associates FDEs to the CIE.
|
||||||
template <class ELFT, class RelTy>
|
template <class ELFT, class RelTy>
|
||||||
void EhFrameSection::addSectionAux(EhInputSection *Sec, ArrayRef<RelTy> Rels) {
|
void EhFrameSection::addSectionAux(EhInputSection *Sec, ArrayRef<RelTy> Rels) {
|
||||||
DenseMap<size_t, CieRecord *> OffsetToCie;
|
OffsetToCie.clear();
|
||||||
for (EhSectionPiece &Piece : Sec->Pieces) {
|
for (EhSectionPiece &Piece : Sec->Pieces) {
|
||||||
// The empty record is the end marker.
|
// The empty record is the end marker.
|
||||||
if (Piece.Size == 4)
|
if (Piece.Size == 4)
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,10 @@ public:
|
||||||
ArrayRef<CieRecord *> getCieRecords() const { return CieRecords; }
|
ArrayRef<CieRecord *> getCieRecords() const { return CieRecords; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// This is used only when parsing EhInputSection. We keep it here to avoid
|
||||||
|
// allocating one for each EhInputSection.
|
||||||
|
llvm::DenseMap<size_t, CieRecord *> OffsetToCie;
|
||||||
|
|
||||||
uint64_t Size = 0;
|
uint64_t Size = 0;
|
||||||
|
|
||||||
template <class ELFT, class RelTy>
|
template <class ELFT, class RelTy>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue