RFR: 8357268: Use JavaNioAccess.getBufferAddress rather than DirectBuffer.address() [v8]

Alan Bateman alanb at openjdk.org
Mon May 26 16:07:54 UTC 2025


On Mon, 26 May 2025 14:22:10 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> This PR proposes to use  `JavaNioAccess::getBufferAdress` rather than `DirectBuffer::address` so that `Buffer` instances backed by MemorySegment instances can be used in classes that were not covered by https://github.com/openjdk/jdk/pull/25321
>> 
>> This PR passes tier1, tier2, and tier3 tests on multiple platforms and configurations.
>
> Per Minborg has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Address comments

src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousFileChannelImpl.java line 669:

> 667: 
> 668:             } finally {
> 669:                 IOUtil.releaseScope(buf);

I don't think we can release here when there is an I/O pending. I suspect it will need to go into releaseBufferIfSubstituted. 

TBH, I think the change to Windows implementation of AsynchronousFileChannel are going to take more eyes and significant testing. What would you think about dropping it from this PR and creating a separate JBS issue as this is going to require more cycles that everything else in this PR.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25324#discussion_r2107608913


More information about the net-dev mailing list