RFR: 8287089: G1: Change const <type>* name to <type>* const name in arguments
Thomas Schatzl
tschatzl at openjdk.java.net
Fri May 20 16:09:12 UTC 2022
Hi all,
can I have reviews for this change that fixes as few `const` modifiers, making them more consistent; mostly changing `const <type>* something` to `<type>* const something` as in many cases the pointer value should be constant, not the thing that is pointed to.
I also considered changing `const <typedef> something` where `typedef` is a pointer type (e.g. `oop` is `oopDesc*`), but `const oop something` is equal to `oop const something` (it only concerns `oop` in our code) to minimize the changes. If you think we should change these argument declarations to `oop const something` to be similar to other code, I can do that.
This is a preparatory change for [JDK-8210708](https://bugs.openjdk.java.net/browse/JDK-8210708) where some of the affected method get another parameter, and it looks weird to have e.g. `block_start(const HeapWord* addr, HeapWord* const pb)`, i.e. two parameters where although both are meant to be constant pointers, they have different `const`s.
Testing: local compilation, GHA
Thanks,
Thomas
-------------
Commit messages:
- 8287089: G1: Change const <type>* name to <type>* const name in arguments
Changes: https://git.openjdk.java.net/jdk/pull/8815/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8815&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8287089
Stats: 40 lines in 8 files changed: 0 ins; 4 del; 36 mod
Patch: https://git.openjdk.java.net/jdk/pull/8815.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/8815/head:pull/8815
PR: https://git.openjdk.java.net/jdk/pull/8815
More information about the hotspot-gc-dev
mailing list