RFR: 8358537: (bf) JavaNioAccess::getBufferAddress bypasses direct buffer MemorySession state check

Jorn Vernee jvernee at openjdk.org
Tue Jun 3 21:42:15 UTC 2025


On Tue, 3 Jun 2025 20:46:49 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Add package-scope `long java.nio.Buffer::address()` to simply return the value of the `address` instance variable; use this method in `JavaNioAccess::getBufferAddress`.

test/jdk/java/nio/channels/etc/MemorySegments.java line 61:

> 59:      */
> 60:     static Stream<Supplier<Arena>> arenaSuppliers() {
> 61:         return Stream.of(Arena::global, Arena::ofAuto, Arena::ofConfined);

Why is using a shared arena causing the UOE to be thrown? I'd think that would be triggered by the use of heap buffers, but shared arena is for off-heap memory.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25631#discussion_r2124976750


More information about the nio-dev mailing list