We want to change GrowableArray to not initialize elements in the range from size to capacity. (JDK-8319115)
We also want to change GrowableArray to be something like standard C++ "allocator aware", to permit allocator-using element types (like GrowableArray!). (No JBS issue yet, I think.) One reason for doing this is to allow detecting that the allocator is an arena style allocator and skipping element destruction.
As a precondition to those, all operations that change the size need to have access to the allocator. All operations that may increase the size might need to grow the underlying storage, so are already provided at the GrowableArrayWithAllocator layer. But operations that reduce the size are in GrowableArrayView, or even GrowableArrayBase. Those operations should be moved to GrowableArrayWithAllocator.
We also want to change GrowableArray to be something like standard C++ "allocator aware", to permit allocator-using element types (like GrowableArray!). (No JBS issue yet, I think.) One reason for doing this is to allow detecting that the allocator is an arena style allocator and skipping element destruction.
As a precondition to those, all operations that change the size need to have access to the allocator. All operations that may increase the size might need to grow the underlying storage, so are already provided at the GrowableArrayWithAllocator layer. But operations that reduce the size are in GrowableArrayView, or even GrowableArrayBase. Those operations should be moved to GrowableArrayWithAllocator.
- relates to
-
JDK-8319115 GrowableArray: Do not initialize up to capacity
-
- Open
-
- links to
-
Review(master) openjdk/jdk/26726