[foreign-memaccess+abi] RFR: 8291473: Unify MemorySegment and MemoryAddress [v5]

Radoslaw Smogura duke at openjdk.org
Fri Jul 29 06:59:47 UTC 2022


On Thu, 28 Jul 2022 17:09:34 GMT, Radoslaw Smogura <duke at openjdk.org> wrote:

>> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add missing copyright headers
>>   Revert BulkMismatchAcquire benchmark
>>   Fix misc issues in tests and benchmarks
>
> src/java.base/share/classes/jdk/internal/foreign/HeapMemorySegmentImpl.java line 66:
> 
>> 64:     @Override
>> 65:     public Optional<Object> array() {
>> 66:         return Optional.of(base);
> 
> I wonder if we should use here `ofNullable`

I would like to recall this comment. Even if it would look better from language perspective, having not specialized `Optional` can make `Unsafe` operations slower, as the VM can make issues with detecting if it's on heap or off-heap access.

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

PR: https://git.openjdk.org/panama-foreign/pull/694


More information about the panama-dev mailing list