[llvm-commits] [PATCH 1/5] Prevent infinite growth of the DenseMap.

jfonseca at vmware.com jfonseca at vmware.com
Thu Mar 24 07:30:34 PDT 2011


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.
---
 include/llvm/ADT/DenseMap.h |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Prevent-infinite-growth-of-the-DenseMap.patch
Type: text/x-patch
Size: 835 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110324/a040e88c/attachment.bin>


More information about the llvm-commits mailing list