RFR: 8310843: Reimplement ByteArray and ByteArrayLittleEndian with Unsafe [v6]

Glavo duke at openjdk.org
Thu Jun 29 08:02:56 UTC 2023


On Thu, 29 Jun 2023 07:41:29 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> You'll need to go back through the discussion in the original PRs (there was more than one) as there was lengthy discussion this already.

https://github.com/openjdk/jdk/pull/11840#discussion_r1064489163

Are you referring to this discussion?

I understand the original reason for retaining it before, but this discussion is outdated for this PR.

`Unsafe` does not provide `getFloatUnaligned`/`getDoubleUnaligned` and `putFloatUnaligned`/`putDoubleUnaligned`, so we must convert floating point numbers to integers here. This problem is no longer hidden behind `VarHanle`, so we have to face it.

In addition, these comments are indeed wrong and may mislead users. I saw this mentioned in the previous discussion, but I don't know why the document was not cleaned up. I think it's time to clean it up.

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

PR Comment: https://git.openjdk.org/jdk/pull/14636#issuecomment-1612589459


More information about the core-libs-dev mailing list