[PATCH] D53260: [ADT] Fix a bug in DenseSet's initializer_list constructor.
Duncan P. N. Exon Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 15 13:37:14 PDT 2018
dexonsmith added a comment.
In https://reviews.llvm.org/D53260#1265712, @lhames wrote:
> Committed as r344542.
>
> In https://reviews.llvm.org/D53260#1265686, @dblaikie wrote:
>
> > Looks good to me (I guess the capacity thing there could be tested too - ensuring that it didn't roll up to a larger capacity than intended?)
>
>
> Unfortunately DenseSet / DenseMap do not expose a capacity function at the moment. I believe it's just getNumBuckets, so unless there is some reason not to I would be in favor of adding a public 'capacity' function that returns that. Then we could add that check to the unit test.
Capacity is the number of elements that can be held without additional allocation, right? So that would be closer to `getNumBuckets()/4*3`.
Repository:
rL LLVM
https://reviews.llvm.org/D53260
More information about the llvm-commits
mailing list