[jdk16] RFR: 8259634: MemorySegment::asByteBuffer does not respect spatial bounds
alanb at openjdk.java.net
Tue Jan 12 16:16:02 UTC 2021
On Tue, 12 Jan 2021 15:28:20 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> The byte buffers created from heap segments do not honor the javadoc - which says that the resulting buffer size should be equal to MemorySegment::byteSize, and that the buffer position should be zero.
> The issue is that the NIO routine we have added to create heap buffers is using the wrong constructor, which doesn't do what we need. The fix is to simply use the proper, more complete constructor.
> I've also re-enabled an unrelated test which was missing the @Test annotation.
Marked as reviewed by alanb (Reviewer).
More information about the core-libs-dev