In 254760, I introduced the usage of a BumpPtrAllocator for the AnalysisUsage instances held by the PassManger. This turns out to have been incorrect since a BumpPtrAllocator does not run the destructors of objects when deallocating memory. Since a few of our SmallVector's had grown beyond their small size, we end up with some leaked memory. We need to use a SpecificBumpPtrAllocator instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254803
91177308-0d34-0410-b5e6-
96231b3b80d8
// Allocator used for allocating UAFoldingSetNodes. This handles deletion of
// all allocated nodes in one fell swoop.
- BumpPtrAllocator AUFoldingSetNodeAllocator;
+ SpecificBumpPtrAllocator<AUFoldingSetNode> AUFoldingSetNodeAllocator;
// Maps from a pass to it's associated entry in UniqueAnalysisUsages. Does
// not own the storage associated with either key or value..
if (auto *N = UniqueAnalysisUsages.FindNodeOrInsertPos(ID, IP))
Node = N;
else {
- Node = new (AUFoldingSetNodeAllocator) AUFoldingSetNode(AU);
+ Node = new (AUFoldingSetNodeAllocator.Allocate()) AUFoldingSetNode(AU);
UniqueAnalysisUsages.InsertNode(Node, IP);
}
assert(Node && "cached analysis usage must be non null");