RFR: 8327093: Add slice function to BitMap API [v2]

Matias Saavedra Silva matsaave at openjdk.org
Tue Mar 5 18:35:58 UTC 2024


> The BitMap does not currently have a "slice" method which can return a subset of the bitmap defined by a start and end bit. This utility can be used to analyze portions of a bitmap or to overwrite the existing map with a shorter, modified map. 
> 
> This implementation has two core methods: 
> `copy_of_range` allocates and returns a new word array as used internally by BitMap
> `truncate` overwrites the internal array with the one generated by `copy_of_range` so none of the internal workings are exposed to callers outside of BitMap.
> 
> This change is verified with an included test.

Matias Saavedra Silva has updated the pull request incrementally with one additional commit since the last revision:

  Axel comments

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/18092/files
  - new: https://git.openjdk.org/jdk/pull/18092/files/f190f78c..95683209

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=18092&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=18092&range=00-01

  Stats: 33 lines in 3 files changed: 2 ins; 15 del; 16 mod
  Patch: https://git.openjdk.org/jdk/pull/18092.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/18092/head:pull/18092

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


More information about the hotspot-dev mailing list