On Fri, 6 Mar 2026 06:09:57 GMT, Stefan Karlsson <[email protected]> wrote:

> Note that this requirement makes the `flatArrayOopDesc::obj_at` much more 
> dangerous to use than the old objArrayOopDesc::obj_at. Every place where we 
> use this function and then make a publishing store needs to remember to 
> perform this barrier. I wonder if we shouldn't find another, more conspicuous 
> name that makes the users / readers aware that this is can be dangerous to 
> use. Alternatively, push the barrier into the `obj_at` function?

It's a fair point. The safest approach would be to add the barrier in the 
buffering code itself, so no code getting a freshly buffered value, knowingly 
or not, would have to worry about this memory issue. This would mean adding the 
barrier in FlatValuePayload::read(TRAPS).

I'll move the barrier and update the test accordingly.

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

PR Comment: https://git.openjdk.org/valhalla/pull/2183#issuecomment-4013943913

Reply via email to