equal
deleted
inserted
replaced
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; |