RFR: 7903626: Add struct helper method to reintrepret an array of structs
Jorn Vernee
jvernee at openjdk.org
Tue Jan 16 15:48:55 UTC 2024
On Tue, 16 Jan 2024 15:26:27 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> Should the simpler reinterpret method call the array one with length of 1 ?
>
>> Should the simpler reinterpret method call the array one with length of 1 ?
>
> yes, good suggestion
As for using asSlice as an alignment check. We don't have an asSlice method in MS which takes an element count, so we would also have to create a SequenceLayout on the fly. Not sure what to do... kinda feels like we need a reinterpret overload that takes an alignment, or another more convenient way to check alignment.
I think in principle checking alignment here is a good idea, since we're 'sanitizing' a raw address here, and an alignment check is a good way to catch corrupt pointers.
-------------
PR Review Comment: https://git.openjdk.org/jextract/pull/178#discussion_r1453617631
More information about the jextract-dev
mailing list