StringMap ctor accepts an initialize size, but expect it to be
rounded to the next power of 2. The ctor can handle that directly
instead of expecting clients to round it. Also, since the map will
resize itself when 75% full, take this into account an initialize
a larger initial size to avoid any growth.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Could you include a test that demonstrates non-growth (I think someone
contributed a similar patch for DenseMap's growth recently - could check
how that was tested (I think it could be tested better with a move-counting
object, for example, but not a strict requirement))?
Comment Actions
Seems good to me otherwise.
unittests/ADT/StringMapTest.cpp | ||
---|---|---|
385–386 | feels a bit off to say "picked without any good reason" - we should have reasons for things. That doesn't mean the specific values are important, maybe "Sampled test cases - a boundary case, a power of two, and a non-power-of-two" ? Not sure |
feels a bit off to say "picked without any good reason" - we should have reasons for things. That doesn't mean the specific values are important, maybe "Sampled test cases - a boundary case, a power of two, and a non-power-of-two" ? Not sure