[foreign-memaccess+abi] RFR: 8310048: Drop sequence layout factory with inferred count

Jorn Vernee jvernee at openjdk.org
Wed Jun 14 18:10:24 UTC 2023


On Wed, 14 Jun 2023 17:50:32 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> 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.

Marked as reviewed by jvernee (Committer).

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

PR Review: https://git.openjdk.org/panama-foreign/pull/838#pullrequestreview-1480036003


More information about the panama-dev mailing list