On Fri, 11 Feb 2022 19:32:48 GMT, XenoAmess <d...@openjdk.java.net> wrote:

>> 8281631: HashMap.putAll can cause redundant space waste
>
> XenoAmess has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   9072610: HashMap.putAll can cause redundant space waste

OK. The changes to HashMap and WeakHashMap look like they're on the right 
track. The changes to j.l.Class and the EnumConstantDirectory test don't belong 
here -- these are _uses_ of HashMap. This bug and fix should focus on HashMap 
itself, to ensure that the cases in question allocate a table of the right size.

Are there any other maps that have this computation besides HashMap and 
WeakHashMap?

There should be a regression test for this. It's probably sufficient to base 
this on your original test program, which puts 12 entries into a HashMap using 
a variety of techniques. It should assert that the table size is 16 in all 
cases. Also, should there be a test case for WeakHashMap?

Also, I changed the summary of the bug report to be more precise. The PR title 
will need to be changed to correspond to it. Thanks.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7431

Reply via email to