RFR: 8301136: Improve unlink() and unlink_all() of ResourceHashtableBase

Xin Liu xliu at openjdk.org
Thu Jan 26 10:13:14 UTC 2023


1. Apply the same idea of JDK-8300184 to unlink().
2. Because ResourceHashtableBase doesn't support copy constructor and copy assignment, client of it has to purge all elements first. We would like provide a specialized version called 'unlink_all()'. 
We don't need to update each node's _next in this case. We only nullify all buckets. We also use unlink_all() in destructor. Despite this isn't the optimal code for a destructor, we reduce maintenance cost.

-------------

Commit messages:
 - 8301136: Improve unlink() and unlink_all() of ResourceHashtableBase

Changes: https://git.openjdk.org/jdk/pull/12213/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12213&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8301136
  Stats: 81 lines in 2 files changed: 67 ins; 10 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/12213.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12213/head:pull/12213

PR: https://git.openjdk.org/jdk/pull/12213


More information about the hotspot-dev mailing list