Skip to content

Commit

Permalink
8301117: Remove old_size param from ResizeableResourceHashtable::resi…
Browse files Browse the repository at this point in the history
…ze()

Reviewed-by: dholmes, coleenp
  • Loading branch information
afshin-zafari authored and calvinccheung committed Mar 3, 2023
1 parent 5085bd5 commit ae797c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/g1/g1CodeRootSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void G1CodeRootSet::add(nmethod* nm) {
}
added = _table->put(nm, nm);
if (added && _table->table_size() == SmallSize && length() == Threshold) {
_table->resize(SmallSize, LargeSize);
_table->resize(LargeSize);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/utilities/resizeableResourceHash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,19 @@ class ResizeableResourceHashtable : public ResourceHashtableBase<
}
if (BASE::number_of_entries() / int(old_size) > load_factor) {
unsigned new_size = MIN2<unsigned>(old_size * 2, _max_size);
resize(old_size, new_size);
resize(new_size);
return true;
} else {
return false;
}
}

void resize(unsigned old_size, unsigned new_size) {
void resize(unsigned new_size) {
Node** old_table = BASE::_table;
Node** new_table = BASE::alloc_table(new_size);

Node* const* bucket = old_table;
while (bucket < &old_table[old_size]) {
while (bucket < &old_table[BASE::_table_size]) {
Node* node = *bucket;
while (node != nullptr) {
Node* next = node->_next;
Expand Down

1 comment on commit ae797c6

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.