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

Johan Sjölen jsjolen at openjdk.org
Mon Nov 6 15:44:39 UTC 2023


> Hi, 
> 
> When using at_put and at_put_grow you can provide a value which will be supplied to the constructor of each element. In other words, you can intialize each element through a copy constructor.
> 
> I suggest that we also provide a function equivalent where the function is provided a pointer to the memory to be initialized. This can be used for `NONCOPYABLE` classes, for example.
> 
> This is implemented using a SFINAE pattern because `nullptr` introduces ambiguity if you use static overload.
> 
> Currently running tier1-tier4.

Johan Sjölen has updated the pull request incrementally with four additional commits since the last revision:

 - Add another test
 - Reintroduce the functional variant
 - Remove unnecessary
 - 1 space

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/16409/files
  - new: https://git.openjdk.org/jdk/pull/16409/files/535c5c9d..7365593d

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=16409&range=09
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16409&range=08-09

  Stats: 115 lines in 4 files changed: 66 ins; 40 del; 9 mod
  Patch: https://git.openjdk.org/jdk/pull/16409.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16409/head:pull/16409

PR: https://git.openjdk.org/jdk/pull/16409


More information about the hotspot-dev mailing list