RFR: 8343188: Investigate ways to simplify MemorySegment::ofBuffer [v5]

Per Minborg pminborg at openjdk.org
Fri Nov 1 07:47:28 UTC 2024


On Thu, 31 Oct 2024 19:06:16 GMT, ExE Boss <duke at openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/foreign/AbstractMemorySegmentImpl.java line 526:
>> 
>>> 524:         final Object base = NIO_ACCESS.getBufferBase(b);
>>> 525:         return (base == null)
>>> 526:                 ? nativeSegment(b, offset, length)
>> 
>> why not calling the other "heapSegment" ?
>
> Because heap segments don’t have to be backed by an array.

The reason was what @ExE-Boss mentioned but for me, I am happy with either name. I will update to `heapSegment()`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21764#discussion_r1825543298


More information about the core-libs-dev mailing list