Re: RFR: 8281631: HashMap copy constructor and putAll can over-allocate table [v28]

2022-03-10 Thread XenoAmess
On Thu, 10 Mar 2022 22:37:58 GMT, Roger Riggs wrote: > Heads up here! java.lang.Integer is specified as a value based class and > should not be used where identity is needed. > https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/doc-files/ValueBased.html > > I don't have a r

Re: RFR: 8281631: HashMap copy constructor and putAll can over-allocate table [v28]

2022-03-10 Thread XenoAmess
On Thu, 10 Mar 2022 22:21:28 GMT, Stuart Marks wrote: > The difficulty with having a loop instead of constants is that the expected > value now needs to be computed. We could probably use `tableSizeFor` to do > this. But this is starting to get uncomfortably close to a testing > antipattern wh

Re: RFR: 8281631: HashMap copy constructor and putAll can over-allocate table [v28]

2022-03-10 Thread Roger Riggs
On Thu, 10 Mar 2022 22:01:49 GMT, Stuart Marks wrote: >> @stuart-marks please have a look in changes in the latest commit, I think >> we'd better to manually create references for keys like that. > > Good point about WeakHashMap! I don't think we need a separate table. Since > the value is held

Re: RFR: 8281631: HashMap copy constructor and putAll can over-allocate table [v28]

2022-03-10 Thread Stuart Marks
On Thu, 10 Mar 2022 16:10:31 GMT, XenoAmess wrote: >> XenoAmess has updated the pull request incrementally with five additional >> commits since the last revision: >> >> - clean out tests >> - Remove 'randomness' keyword. >> - Cleanup and commenting. >> - initial rewrite of WhiteBoxResizeTe

Re: RFR: 8281631: HashMap copy constructor and putAll can over-allocate table [v28]

2022-03-10 Thread Stuart Marks
On Thu, 10 Mar 2022 16:22:29 GMT, XenoAmess wrote: >> test/jdk/java/util/HashMap/WhiteBoxResizeTest.java line 116: >> >>> 114: } >>> 115: >>> 116: void putN(Map map, int n) { >> >> @stuart-marks well we know this is correct for WeakHashMap when n < >> IntegerCache.high because we have

Re: RFR: 8281631: HashMap copy constructor and putAll can over-allocate table [v28]

2022-03-10 Thread XenoAmess
On Thu, 10 Mar 2022 16:15:03 GMT, XenoAmess wrote: >> XenoAmess has updated the pull request incrementally with five additional >> commits since the last revision: >> >> - clean out tests >> - Remove 'randomness' keyword. >> - Cleanup and commenting. >> - initial rewrite of WhiteBoxResizeTe

Re: RFR: 8281631: HashMap copy constructor and putAll can over-allocate table [v28]

2022-03-10 Thread XenoAmess
On Thu, 10 Mar 2022 16:13:42 GMT, XenoAmess wrote: >> 8281631: HashMap copy constructor and putAll can over-allocate table > > XenoAmess has updated the pull request incrementally with five additional > commits since the last revision: > > - clean out tests > - Remove 'randomness' keyword. >

Re: RFR: 8281631: HashMap copy constructor and putAll can over-allocate table [v28]

2022-03-10 Thread XenoAmess
> 8281631: HashMap copy constructor and putAll can over-allocate table XenoAmess has updated the pull request incrementally with five additional commits since the last revision: - clean out tests - Remove 'randomness' keyword. - Cleanup and commenting. - initial rewrite of WhiteBoxResizeTest