[foreign-memaccess+abi] RFR: 8310048: Drop sequence layout factory with inferred count
Maurizio Cimadamore
mcimadamore at openjdk.org
Wed Jun 14 17:58:38 UTC 2023
The sequence layout factory that accepts only the element layout makes it too easy for developers to reach for the wrong thing (and creating an insanely huge layout).
We should keep in sync with the WYSIWYG spirit of the various layout factories and make sequence layout count always explicit.
Developers should not need to create a sequence layout whose size is `Long.MAX_VALUE`, except in the specific case when they would like to create an address layout whose target layout has a size that is statically unknown (and they's like the FFM API to automatically resize the resulting segment to the biggest available size).
We have other patches in the work which will help developers deal with cases where they have to deal with access to elements of an array whose size is not known statically.
-------------
Commit messages:
- Initial push
Changes: https://git.openjdk.org/panama-foreign/pull/838/files
Webrev: https://webrevs.openjdk.org/?repo=panama-foreign&pr=838&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8310048
Stats: 51 lines in 13 files changed: 2 ins; 26 del; 23 mod
Patch: https://git.openjdk.org/panama-foreign/pull/838.diff
Fetch: git fetch https://git.openjdk.org/panama-foreign.git pull/838/head:pull/838
PR: https://git.openjdk.org/panama-foreign/pull/838
More information about the panama-dev
mailing list