@@ -49,21 +49,28 @@ oop JvmtiTagMapEntry::object_no_keepalive() {
49
49
JvmtiTagMapTable::JvmtiTagMapTable ()
50
50
: Hashtable<WeakHandle, mtServiceability>(_table_size, sizeof (JvmtiTagMapEntry)) {}
51
51
52
- JvmtiTagMapTable::~JvmtiTagMapTable () {
53
- // Delete this table
54
- log_debug (jvmti, table)(" JvmtiTagMapTable deleted " );
52
+ void JvmtiTagMapTable::clear () {
53
+ // Clear this table
54
+ log_debug (jvmti, table)(" JvmtiTagMapTable cleared " );
55
55
for (int i = 0 ; i < table_size (); ++i) {
56
56
for (JvmtiTagMapEntry* m = bucket (i); m != NULL ;) {
57
57
JvmtiTagMapEntry* entry = m;
58
58
// read next before freeing.
59
59
m = m->next ();
60
60
free_entry (entry);
61
61
}
62
+ JvmtiTagMapEntry** p = bucket_addr (i);
63
+ *p = NULL ; // clear out buckets.
62
64
}
63
65
assert (number_of_entries () == 0 , " should have removed all entries" );
64
66
assert (new_entry_free_list () == NULL , " entry present on JvmtiTagMapTable's free list" );
65
67
}
66
68
69
+ JvmtiTagMapTable::~JvmtiTagMapTable () {
70
+ clear ();
71
+ // base class ~BasicHashtable deallocates the buckets.
72
+ }
73
+
67
74
// Entries are C_Heap allocated
68
75
JvmtiTagMapEntry* JvmtiTagMapTable::new_entry (unsigned int hash, WeakHandle w, jlong tag) {
69
76
JvmtiTagMapEntry* entry = (JvmtiTagMapEntry*)Hashtable<WeakHandle, mtServiceability>::allocate_new_entry (hash, w);
0 commit comments