RFR: 8247755: Leaner and more versatile GrowableArray classes

Stefan Karlsson stefan.karlsson at oracle.com
Tue Jun 23 14:07:31 UTC 2020


This hopefully addresses all your items below:
  https://cr.openjdk.java.net/~stefank/8247755/webrev.03.delta/
  https://cr.openjdk.java.net/~stefank/8247755/webrev.03/

Thanks,
StefanK

On 2020-06-23 15:42, Kim Barrett wrote:
>> On Jun 23, 2020, at 6:23 AM, Stefan Karlsson <stefan.karlsson at oracle.com> wrote:
>>
>> Latest patches:
>> https://cr.openjdk.java.net/~stefank/8247755/webrev.02.delta/
>> https://cr.openjdk.java.net/~stefank/8247755/webrev.02/
>>
>> I haven't changed:
>> - GrowableArrayView to something else
>> - S to ALLOC or Derived. I'm leaning towards Derived.
> 
> Lacking a really better alternative to offer, I’ll drop the objection to GrowableArrayView.
> 
> I’m okay with Derived, obviously.
> 
> webrev.02 doesn't seem to have fully addressed this comment from my
> first review message:
> 
> src/hotspot/share/utilities/growableArray.hpp
> 
> -----
> Destructors for all but the most-derived classes should be non-public.
> Probably also the constructors.  That is, all of GrowableArrayBase,
> GrowableArrayView, and GrowableArrayWithAllocator should have
> protected constructors and destructors.
> -----
> 
> The constructors are now protected, but these all have default
> (public) destructors, and it's the destructor that generally prevents
> inadvertent slicing, especially since we have defaults for copy and
> assign; if either of those get used, the lack of an accessible destructor
> will generally trigger a compile-time error.
> 


More information about the hotspot-dev mailing list