src/hotspot/share/gc/g1/sparsePRT.cpp
changeset 58084 cddef3bde924
parent 55510 3e31a8beaae4
child 58679 9c3209ff7550
child 59290 97d13893ec3c
equal deleted inserted replaced
58083:9046db64ca39 58084:cddef3bde924
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   102   _entries = (SparsePRTEntry*)NEW_C_HEAP_ARRAY(char, _num_entries * SparsePRTEntry::size(), mtGC);
   102   _entries = (SparsePRTEntry*)NEW_C_HEAP_ARRAY(char, _num_entries * SparsePRTEntry::size(), mtGC);
   103   clear();
   103   clear();
   104 }
   104 }
   105 
   105 
   106 RSHashTable::~RSHashTable() {
   106 RSHashTable::~RSHashTable() {
   107   if (_entries != NULL) {
   107   FREE_C_HEAP_ARRAY(SparsePRTEntry, _entries);
   108     FREE_C_HEAP_ARRAY(SparsePRTEntry, _entries);
   108   FREE_C_HEAP_ARRAY(int, _buckets);
   109     _entries = NULL;
       
   110   }
       
   111   if (_buckets != NULL) {
       
   112     FREE_C_HEAP_ARRAY(int, _buckets);
       
   113     _buckets = NULL;
       
   114   }
       
   115 }
   109 }
   116 
   110 
   117 void RSHashTable::clear() {
   111 void RSHashTable::clear() {
   118   _occupied_entries = 0;
   112   _occupied_entries = 0;
   119   _occupied_cards = 0;
   113   _occupied_cards = 0;