Mercurial > hg > truffle
comparison src/share/vm/utilities/array.hpp @ 6197:d2a62e0f25eb
6995781: Native Memory Tracking (Phase 1)
7151532: DCmd for hotspot native memory tracking
Summary: Implementation of native memory tracking phase 1, which tracks VM native memory usage, and related DCmd
Reviewed-by: acorn, coleenp, fparain
author | zgu |
---|---|
date | Thu, 28 Jun 2012 17:03:16 -0400 |
parents | f95d63e2154a |
children | da91efe96a93 |
comparison
equal
deleted
inserted
replaced
6174:74533f63b116 | 6197: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 |