RFR: 8247755: Leaner and more versatile GrowableArray classes

Kim Barrett kim.barrett at oracle.com
Tue Jun 23 14:31:24 UTC 2020


> On Jun 23, 2020, at 10:07 AM, Stefan Karlsson <stefan.karlsson at oracle.com> wrote:
> 
> 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/

This change caused me to notice a different problem.
~GrowableArrayCHeap should call clear_and_deallocate().

Also, I previously missed that allocate and deallocate are public in
GrowableArray &etc. This is presumably so they can be called by the
CRTP'ed base class. Rather than exposing implementation details in the
public API, it's common practice with CRTP for the derived class to
befriend the base class. Or there are more complicated idioms.

https://stackoverflow.com/questions/8523762/crtp-with-protected-derived-member
https://accu.org/index.php/journals/296




More information about the hotspot-dev mailing list