On Thu, 3 Mar 2022 15:46:37 GMT, XenoAmess <d...@openjdk.java.net> wrote:
>> 8281631: HashMap copy constructor and putAll can over-allocate table > > XenoAmess has updated the pull request incrementally with one additional > commit since the last revision: > > cast several float to double before calculation src/java.base/share/classes/java/util/WeakHashMap.java line 469: > 467: Entry<K,V> e = tab[i]; > 468: tab[i] = new Entry<>(k, value, queue, h, e); > 469: if (++size > threshold) Good catch here, by the way. The old code clearly expanded the map prematurely. ------------- PR: https://git.openjdk.java.net/jdk/pull/7431