[lworld] RFR: 8353236: [lworld] Better documentation for Valhalla Unsafe intrinsics [v3]

Chen Liang liach at openjdk.org
Fri May 16 12:29:04 UTC 2025


On Thu, 10 Apr 2025 15:29:40 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> Hi,
>> 
>> This patch clarifies the meaning of undefined behavior when working with `Unsafe` and specifies the requirements when working with `Unsafe::makePrivateBuffer` and `Unsafe::finishPrivateBuffer`.
>> 
>> Please take a look and leave your suggestions, thanks a lot.
>
> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
> 
>   remove unnecessary statements

src/java.base/share/classes/jdk/internal/misc/Unsafe.java line 70:

> 68:  * <li>Impossible code execution. E.g. the branches of an {@code if} are
> 69:  * both executed or both not executed.
> 70:  * <li>Wiping out the hard drive.

I think these are just for alerting people; this is not that valuable to create a huge list to specifically highlight. I think what we should highlight instead is the best practices.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1425#discussion_r2092949536


More information about the valhalla-dev mailing list