RFR: 8319117: GrowableArray: Allow for custom initializer instead of copy constructor [v2]

Johan Sjölen jsjolen at openjdk.org
Tue Oct 31 12:31:47 UTC 2023


On Tue, 31 Oct 2023 12:21:43 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> Johan Sjölen has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Use variadic templates for in-place construction
>>  - Two tests
>
> src/hotspot/share/utilities/growableArray.hpp line 405:
> 
>> 403:   void push(const E& elem) { append(elem); }
>> 404: private:
>> 405:   static void default_fill(E* ptr) {
> 
> This method is unused I believe

I hoped I'd manage to push a fix for that before anyone saw it :-).

>Should this be Args&... args?

Yes.

>Also this method is returning a value instead of a reference, is it intentional?

That is difficult to say. The caller can decided whether to capture the value by-reference or by-value either way.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16409#discussion_r1377508655
PR Review Comment: https://git.openjdk.org/jdk/pull/16409#discussion_r1377507934


More information about the hotspot-dev mailing list