RFR: 8166651: OrderAccess::load_acquire &etc should have const parameters (original) (raw)
Erik Ă–sterlund erik.osterlund at oracle.com
Fri May 26 12:04:36 UTC 2017
- Previous message: RFR: 8166651: OrderAccess::load_acquire &etc should have const parameters
- Next message: RFR: 8166651: OrderAccess::load_acquire &etc should have const parameters
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Kim,
Thanks for doing this. It looks good to me.
/Erik
On 2017-05-25 01:42, Kim Barrett wrote:
Please review this change to Atomic::load and OrderAccess::loadacquire overloads to make their source const qualified, e.g. instead of "volatile T*" make them "const volatile T*". This eliminates the need for casting away const when, for example, applying one of these operations to a member variable when in a const-qualified method.
There are probably places that previously required casting away const but now do not. Similarly, there are probably places where values couldn't be const or member functions couldn't be const qualified, but now can be. I did a little searching and found a few candidates, but none that were otherwise trivial to add to this change, so haven't included any. This change touches platform-specific code for non-Oracle supported platforms that I can't test, so I'd like reviews from the respective platform owners. _Aside regarding aarch64: I don't know why gcc's atomicload doesn't const-qualify the source argument; that seems like a bug. Or maybe they are, but not documented that way. And I wonder why the aarch64 _port uses _atomicload rather than atomicloadn. CR: https://bugs.openjdk.java.net/browse/JDK-8166651 Webrev: http://cr.openjdk.java.net/~kbarrett/8166651/hotspot.00 Testing: JPRT
- Previous message: RFR: 8166651: OrderAccess::load_acquire &etc should have const parameters
- Next message: RFR: 8166651: OrderAccess::load_acquire &etc should have const parameters
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]