< prev index next >

src/hotspot/share/gc/z/zArray.hpp

Print this page

        

*** 24,66 **** #ifndef SHARE_GC_Z_ZARRAY_HPP #define SHARE_GC_Z_ZARRAY_HPP #include "memory/allocation.hpp" #include "utilities/globalDefinitions.hpp" template <typename T> ! 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); ! public: ZArray(); - ~ZArray(); - - size_t size() const; - bool is_empty() const; - - T at(size_t index) const; - void add(T value); void transfer(ZArray<T>* from); - void clear(); }; template <typename T, bool parallel> class ZArrayIteratorImpl : public StackObj { private: ZArray<T>* const _array; ! size_t _next; public: ZArrayIteratorImpl(ZArray<T>* array); bool next(T* elem); --- 24,48 ---- #ifndef SHARE_GC_Z_ZARRAY_HPP #define SHARE_GC_Z_ZARRAY_HPP #include "memory/allocation.hpp" #include "utilities/globalDefinitions.hpp" + #include "utilities/growableArray.hpp" template <typename T> ! class ZArray : public GrowableArrayCHeap<T, mtGC> { public: ZArray(); void transfer(ZArray<T>* from); }; template <typename T, bool parallel> class ZArrayIteratorImpl : public StackObj { private: ZArray<T>* const _array; ! int _next; public: ZArrayIteratorImpl(ZArray<T>* array); bool next(T* elem);
< prev index next >