On Tue, 20 May 2025 07:37:34 GMT, Per Minborg <[email protected]> wrote:
> This PR proposes to use ` JavaNioAccess::getBufferAdress` rather than
> `DirectBuffer::address` in the package `java.util.zip` so that `Buffer`
> instances backed by `MemorySegment` instances can be used.
>
> This PR passes tier1, tier2, and tier3 tests on multiple platforms and
> configurations.
src/java.base/share/classes/java/util/zip/Adler32.java line 102:
> 100: NIO_ACCESS.acquireSession(buffer);
> 101: try {
> 102: adler = updateByteBuffer(adler,
> NIO_ACCESS.getBufferAddress(buffer), pos, rem);
Hello Per, from what I can see in the implementation of
`NIO_ACCESS.getBufferAddress(...)` it merely returns `buffer.address`
https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/nio/Buffer.java#L862.
So if I understand this change correctly, what we are proposing here is that
we want to avoid the additional checks (checks related to `MemorySegment` that
can fail?) that are there in the `DirectBuffer.address()` method
implementation? Is that what this change is addressing?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25321#discussion_r2100361279