[14] RFR(XS): 8156207 : Resource allocated BitMaps are often cleared unnecessarily

Kim Barrett kim.barrett at oracle.com
Mon Jul 29 22:10:24 UTC 2019


> On Jul 29, 2019, at 5:38 PM, dean.long at oracle.com wrote:
> 
> I see that this has already been pushed, but I'm just curious, wouldn't this code be clearer if it used a copy ctor?
> 
> ResourceBitMap g(_gen.size(), false); g.set_from(_gen);
> 
> vs
> 
> ResourceBitMap g(_gen);

The current copy constructor definition for ResourceBitMap is the default (shallow) copy,
which isn’t what is wanted here.  I tried experimenting with making ResourceBitMap
noncopyable a while ago, but ran into uses.  Changing the copy constructor to not be
shallow would negatively affect the performance of such uses.  Of course, it might also
positively affect the correctness of some of those uses, if there are existing bugs...



More information about the hotspot-dev mailing list