Mercurial > hg > truffle
comparison src/share/vm/utilities/array.hpp @ 6275:957c266d8bc5
Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 21 Aug 2012 10:39:19 +0200 |
parents | d2a62e0f25eb |
children | da91efe96a93 |
comparison
equal
deleted
inserted
replaced
5891:fd8832ae511d | 6275:957c266d8bc5 |
---|---|
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 |