We should more clearly separate the C-Heap version from the arena / resource area allocation.
Advantages:
- If they are separate subclasses, then we have to do less verification when assigning, copying, allocating etc: fewer mistakes can happen.
- We can establish a clear separation between: take care of allocation/deallocation yourself (C-Heap) vs. abandon memory and the elements still in the array (arena / resource area).
- We should not have multiple implementations of the same thing (C-Heap backed array).
Advantages:
- If they are separate subclasses, then we have to do less verification when assigning, copying, allocating etc: fewer mistakes can happen.
- We can establish a clear separation between: take care of allocation/deallocation yourself (C-Heap) vs. abandon memory and the elements still in the array (arena / resource area).
- We should not have multiple implementations of the same thing (C-Heap backed array).
- relates to
-
JDK-8319115 GrowableArray: Do not initialize up to capacity
- Open
- links to
-
Review openjdk/jdk/17160