src/share/vm/utilities/array.hpp

changeset 3900
d2a62e0f25eb
parent 2314
f95d63e2154a
child 4037
da91efe96a93
equal deleted inserted replaced
3877:74533f63b116 3900:d2a62e0f25eb
77 int length() const { return _length; } 77 int length() const { return _length; }
78 bool is_empty() const { return length() == 0; } 78 bool is_empty() const { return length() == 0; }
79 }; 79 };
80 80
81 81
82 class CHeapArray: public CHeapObj { 82 template <MEMFLAGS F>class CHeapArray: public CHeapObj<F> {
83 protected: 83 protected:
84 int _length; // the number of array elements 84 int _length; // the number of array elements
85 void* _data; // the array memory 85 void* _data; // the array memory
86 86
87 // creation 87 // creation
92 92
93 93
94 CHeapArray(size_t esize, int length) { 94 CHeapArray(size_t esize, int length) {
95 assert(length >= 0, "illegal length"); 95 assert(length >= 0, "illegal length");
96 _length = length; 96 _length = length;
97 _data = (void*) NEW_C_HEAP_ARRAY(char *, esize * length); 97 _data = (void*) NEW_C_HEAP_ARRAY(char *, esize * length, F);
98 } 98 }
99 99
100 #ifdef ASSERT 100 #ifdef ASSERT
101 void init_nesting(); 101 void init_nesting();
102 #endif 102 #endif

mercurial