summaryrefslogtreecommitdiff
path: root/lib/Support/SmallPtrSet.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-03-30 18:32:41 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-03-30 18:32:41 +0000
commit414fdbdb0104fdc8c570287f94df8bb697e7b7c1 (patch)
tree2d95044564b6eb03a7f8ed8a25629d69f5352598 /lib/Support/SmallPtrSet.cpp
parentefe65ce25c2f475ef7a9ea767660b029310e503a (diff)
downloadllvm-414fdbdb0104fdc8c570287f94df8bb697e7b7c1.tar.gz
llvm-414fdbdb0104fdc8c570287f94df8bb697e7b7c1.tar.bz2
llvm-414fdbdb0104fdc8c570287f94df8bb697e7b7c1.tar.xz
Prevent infinite growth of the DenseMap.
When the hash function uses object pointers all free entries eventually become tombstones as they are used at least once, regardless of the size. DenseMap cannot function with zero empty keys, so it double size to get get ridof the tombstones. However DenseMap never shrinks automatically unless it is cleared, so the net result is that certain tables grow infinitely. The solution is to make a fresh copy of the table without tombstones instead of doubling size, by simply calling grow with the current size. Patch by José Fonseca! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128564 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/SmallPtrSet.cpp')
0 files changed, 0 insertions, 0 deletions