RFR: 8312522: Implementation of Foreign Function & Memory API [v16]

Jorn Vernee jvernee at openjdk.org
Fri Sep 8 14:40:47 UTC 2023


On Fri, 8 Sep 2023 11:20:39 GMT, ExE Boss <duke at openjdk.org> wrote:

>> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add support for sliced allocation
>
> src/java.base/share/classes/jdk/internal/foreign/NativeMemorySegmentImpl.java line 154:
> 
>> 152:             return UNSAFE.allocateMemory(size);
>> 153:         } catch (IllegalArgumentException ex) {
>> 154:             throw new OutOfMemoryError();
> 
> `OutOfMemoryError` should be updated to have the `Throwable`‑accepting constructor overloads, so that this can include the cause:
> Suggestion:
> 
>             throw new OutOfMemoryError(ex);
> 
> 
> See also: https://github.com/openjdk/panama-foreign/pull/855#discussion_r1285058300

I think enhancing `OutOfMemoryError` is a discussion to be had separately. Not as a part of this JEP.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15103#discussion_r1319957862


More information about the build-dev mailing list