equal
deleted
inserted
replaced
34 _cache_misses(0) { |
34 _cache_misses(0) { |
35 |
35 |
36 guarantee(is_power_of_2(num_cache_entries), |
36 guarantee(is_power_of_2(num_cache_entries), |
37 "Number of cache entries must be power of two, but is %u", num_cache_entries); |
37 "Number of cache entries must be power of two, but is %u", num_cache_entries); |
38 _cache = NEW_C_HEAP_ARRAY(G1RegionMarkStatsCacheEntry, _num_cache_entries, mtGC); |
38 _cache = NEW_C_HEAP_ARRAY(G1RegionMarkStatsCacheEntry, _num_cache_entries, mtGC); |
39 for (uint i = 0; i < _num_cache_entries; i++) { |
|
40 _cache[i].clear(); |
|
41 } |
|
42 _num_cache_entries_mask = _num_cache_entries - 1; |
39 _num_cache_entries_mask = _num_cache_entries - 1; |
43 } |
40 } |
44 |
41 |
45 G1RegionMarkStatsCache::~G1RegionMarkStatsCache() { |
42 G1RegionMarkStatsCache::~G1RegionMarkStatsCache() { |
46 FREE_C_HEAP_ARRAY(G1RegionMarkStatsCacheEntry, _cache); |
43 FREE_C_HEAP_ARRAY(G1RegionMarkStatsCacheEntry, _cache); |