--- old/src/hotspot/share/gc/z/zArray.hpp 2020-06-17 15:03:20.470789942 +0200 +++ new/src/hotspot/share/gc/z/zArray.hpp 2020-06-17 15:03:20.314787318 +0200 @@ -26,39 +26,21 @@ #include "memory/allocation.hpp" #include "utilities/globalDefinitions.hpp" +#include "utilities/growableArray.hpp" template -class ZArray { -private: - static const size_t initial_capacity = 32; - - T* _array; - size_t _size; - size_t _capacity; - - NONCOPYABLE(ZArray); - - void expand(size_t new_capacity); - +class ZArray : public GrowableArrayCHeap { public: ZArray(); - ~ZArray(); - - size_t size() const; - bool is_empty() const; - - T at(size_t index) const; - void add(T value); void transfer(ZArray* from); - void clear(); }; template class ZArrayIteratorImpl : public StackObj { private: ZArray* const _array; - size_t _next; + int _next; public: ZArrayIteratorImpl(ZArray* array);