RFR: 8357847: (ch) WindowsAsynchronousFileChannelImpl should support FFM Buffers

Brian Burkhalter bpb at openjdk.org
Fri May 30 17:50:50 UTC 2025


On Fri, 30 May 2025 17:24:14 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> We should be able to use a buffer from a view allocated from the global arena or an automatic arena. It should throw UOE for confined and shared.

Currently `genBuffer` in `java/nio/channels/AsynchronousFileChannel/Basic.java` has this case:

            case 2 -> Arena.ofAuto().allocate(buf.length).asByteBuffer()
                    .put(buf)
                    .flip();

Other cases could be added there, e.g.,

            case 2 -> Arena.global().allocate(buf.length).asByteBuffer()
                    .put(buf)
                    .flip();

The UOE for confined and shared might have to be checked elsewhere. I'll examine it further.

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

PR Comment: https://git.openjdk.org/jdk/pull/25531#issuecomment-2923021860


More information about the nio-dev mailing list