RFR: 8319709: Make GrowableArrayCHeap copyable [v2]

David Holmes dholmes at openjdk.org
Thu Nov 9 06:20:57 UTC 2023


On Wed, 8 Nov 2023 14:08:15 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> Hi,
>> 
>> Please consider this code change which makes `GrowableArrayCHeap` copyable. The resulting copy does not share its data array with the original.
>
> Johan Sjölen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Assignment operator takes const reference

What is the motivation for this? Please add something to JBS. Also see query below.

Thanks

src/hotspot/share/utilities/growableArray.hpp line 835:

> 833:     this->grow(other._len);
> 834:     for (int i = 0; i < other._len; i++) {
> 835:       this->_data[i] = other._data[i];

Does this imply that anything you put in a `GrowableArrayCHeap` must itself also be copyable now?

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

PR Review: https://git.openjdk.org/jdk/pull/16559#pullrequestreview-1721781877
PR Review Comment: https://git.openjdk.org/jdk/pull/16559#discussion_r1387533329


More information about the hotspot-dev mailing list