On Fri, 8 Sep 2023 11:20:39 GMT, ExE Boss <d...@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