< prev index next >

src/hotspot/share/gc/g1/sparsePRT.cpp

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.
--- 1,7 ---
  /*
!  * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

*** 102,18 ***
    _entries = (SparsePRTEntry*)NEW_C_HEAP_ARRAY(char, _num_entries * SparsePRTEntry::size(), mtGC);
    clear();
  }
  
  RSHashTable::~RSHashTable() {
!   if (_entries != NULL) {
!     FREE_C_HEAP_ARRAY(SparsePRTEntry, _entries);
-     _entries = NULL;
-   }
-   if (_buckets != NULL) {
-     FREE_C_HEAP_ARRAY(int, _buckets);
-     _buckets = NULL;
-   }
  }
  
  void RSHashTable::clear() {
    _occupied_entries = 0;
    _occupied_cards = 0;
--- 102,12 ---
    _entries = (SparsePRTEntry*)NEW_C_HEAP_ARRAY(char, _num_entries * SparsePRTEntry::size(), mtGC);
    clear();
  }
  
  RSHashTable::~RSHashTable() {
!   FREE_C_HEAP_ARRAY(SparsePRTEntry, _entries);
!   FREE_C_HEAP_ARRAY(int, _buckets);
  }
  
  void RSHashTable::clear() {
    _occupied_entries = 0;
    _occupied_cards = 0;
< prev index next >