Withdrawn: 8287089: G1: Change const <type>* name to <type>* const name in arguments
Thomas Schatzl
tschatzl at openjdk.java.net
Sat May 21 12:43:44 UTC 2022
On Fri, 20 May 2022 16:02:58 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
> 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
This pull request has been closed without being integrated.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8815
More information about the hotspot-gc-dev
mailing list