[foreign-abi] RFR: 8253823: Investigate ways to make handoff-like operation more explicit [v2]
Paul Sandoz
psandoz at openjdk.java.net
Wed Sep 30 15:59:59 UTC 2020
On Wed, 30 Sep 2020 09:59:25 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> `HandoffTransform.identity()` ? That said, while all the operations on the transform are additive (you can add many
>> cleanup actions, many cleaners, many attachment), the confinement property is a one-off thing. So, `identity` doesn't
>> really mean much - in a way, all transforms are `identity` at the start (except for the owner thread). Perhaps a simple
>> HandoffTransform.of(), where we specify that the ownership is the same as that of the source segment.
>
> Yes - this is a dumb holder for accumulated state - my question in the review header was as to whether we're fine with
> it being dumb and mutable and thread unsafe, since that is reflected in the javadoc
`HandoffTransform.of()`, or `ofSource`, seems clear, such that `segment.handOff(HandoffTransform.of())` returns a new
segment with exactly the same properties as the source.
I think being a dumb holder of mutable state is fine. It's simple and there is no binding/reuse issue as, say, with a
builder scoped to a method call.
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/361
More information about the panama-dev
mailing list