hotspot/src/share/vm/gc_implementation/g1/sparsePRT.cpp
changeset 13195 be27e1b6a4b9
parent 12381 1438e0fbfa27
child 17108 cf72dcf9a8f2
equal deleted inserted replaced
13099:64752e56d721 13195:be27e1b6a4b9
   146 // ----------------------------------------------------------------------
   146 // ----------------------------------------------------------------------
   147 
   147 
   148 RSHashTable::RSHashTable(size_t capacity) :
   148 RSHashTable::RSHashTable(size_t capacity) :
   149   _capacity(capacity), _capacity_mask(capacity-1),
   149   _capacity(capacity), _capacity_mask(capacity-1),
   150   _occupied_entries(0), _occupied_cards(0),
   150   _occupied_entries(0), _occupied_cards(0),
   151   _entries((SparsePRTEntry*)NEW_C_HEAP_ARRAY(char, SparsePRTEntry::size() * capacity)),
   151   _entries((SparsePRTEntry*)NEW_C_HEAP_ARRAY(char, SparsePRTEntry::size() * capacity, mtGC)),
   152   _buckets(NEW_C_HEAP_ARRAY(int, capacity)),
   152   _buckets(NEW_C_HEAP_ARRAY(int, capacity, mtGC)),
   153   _free_list(NullEntry), _free_region(0)
   153   _free_list(NullEntry), _free_region(0)
   154 {
   154 {
   155   clear();
   155   clear();
   156 }
   156 }
   157 
   157 
   158 RSHashTable::~RSHashTable() {
   158 RSHashTable::~RSHashTable() {
   159   if (_entries != NULL) {
   159   if (_entries != NULL) {
   160     FREE_C_HEAP_ARRAY(SparsePRTEntry, _entries);
   160     FREE_C_HEAP_ARRAY(SparsePRTEntry, _entries, mtGC);
   161     _entries = NULL;
   161     _entries = NULL;
   162   }
   162   }
   163   if (_buckets != NULL) {
   163   if (_buckets != NULL) {
   164     FREE_C_HEAP_ARRAY(int, _buckets);
   164     FREE_C_HEAP_ARRAY(int, _buckets, mtGC);
   165     _buckets = NULL;
   165     _buckets = NULL;
   166   }
   166   }
   167 }
   167 }
   168 
   168 
   169 void RSHashTable::clear() {
   169 void RSHashTable::clear() {