src/hotspot/share/gc/g1/g1RegionMarkStatsCache.cpp
changeset 50281 bc1336220671
parent 49606 9ae8719efcae
child 51332 c25572739e7c
equal deleted inserted replaced
50280:5aaf3a471172 50281:bc1336220671
    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);