RFR: 8355013: GrowableArray default constructor should not allocate
Quan Anh Mai
qamai at openjdk.org
Fri Apr 18 05:40:24 UTC 2025
Hi,
This patch changes the default constructors of `GrowableArray` so that it does not allocate. This is helpful because sometimes we create a `GrowableArray` and append another into it immediately, or create a `GrowableArray` to merge the value from several branches. In these cases, the default allocation is not needed. This also aligns the behaviour with that of `std::vector`, which does not allocate for default construction.
Please take a look and leave your reviews, thanks a lot.
-------------
Commit messages:
- non-allocating constructors for GrowableArray
Changes: https://git.openjdk.org/jdk/pull/24748/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24748&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8355013
Stats: 25 lines in 2 files changed: 20 ins; 0 del; 5 mod
Patch: https://git.openjdk.org/jdk/pull/24748.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24748/head:pull/24748
PR: https://git.openjdk.org/jdk/pull/24748
More information about the hotspot-dev
mailing list