RFR: Cleanups, TODOs, asserts (part 2)
Kelvin Nilsen
kdnilsen at openjdk.org
Wed Apr 12 13:53:17 UTC 2023
On Wed, 12 Apr 2023 08:04:07 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.hpp line 63:
>>
>>> 61:
>>> 62: // Simple versions of marking accessors, to be used outside of marking (e.g. no possible concurrent updates)
>>> 63: // TODO: Do these really need to be const?
>>
>> It's generally considered good hygiene to `const` read accessors. Any reason you would _not_ want them `const`'d?
>
> I'd like to keep the difference vs upstream at minimum. So my question is, do we need these additions for some build/performance reasons, or this is just a hygienic measure? The hygienic fixes in existing upstream code can be done separately straight in upstream.
slight performance benefit in that const makes certain optimizations easier. Also, a maintainability benefit in that the declarations clarifies programmer intention and prevents violation of intentions...
-------------
PR Review Comment: https://git.openjdk.org/shenandoah/pull/252#discussion_r1164167656
More information about the shenandoah-dev
mailing list