[foreign-memaccess+abi] RFR: 8291639: Improve the ability to visualize a MemorySegment in human readable forms [v2]
Maurizio Cimadamore
mcimadamore at openjdk.org
Fri May 26 14:49:20 UTC 2023
On Fri, 26 May 2023 14:30:10 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> I have a feeling that this could be simplified if we embraced recursion, and defined the mapping as a function taking three arguments: offset, layout and carrier. The output of that function is a MethodHandle. Record mapper is not special - I mean, it is special as that's the only entry point we provide in the API, but that is based on a more general way to map layouts and carriers to value, so we should probably write that general function first, and then map that to the recordMapper API point.
That said, I think your optimization of the one-dimensional case also makes sense, as in those cases we know we can just bulk copy into the target array. So perhaps, the split between one-dimensional and multi-dimensional is gonna remain (but I think in terms of the javadoc, the split shouldn't be there).
-------------
PR Review Comment: https://git.openjdk.org/panama-foreign/pull/833#discussion_r1206899902
More information about the panama-dev
mailing list