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

Alan Bateman alanb at openjdk.org
Fri May 30 17:26:51 UTC 2025


On Fri, 30 May 2025 16:20:12 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> I ran into this in testing:
> 
> ```
>     public long address() {
>         MemorySessionImpl session = session();
>         if (session != null) {
>             if (session.ownerThread() == null && session.isCloseable()) {
>                 throw new UnsupportedOperationException("ByteBuffer derived from closeable shared sessions not supported");
>             }
> ```
> 
> in `Direct-X-Buffer.java.template` when using the result of `Arena.ofShared`.

I previous comment wasn't comment, the above code where it checks isCloseable is correct. 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.

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

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


More information about the nio-dev mailing list