[foreign-abi] RFR: 8248560: Specify the behaviour of the ForeignLinker returned by CSupport::getSystemLinker [v2]

Paul Sandoz psandoz at openjdk.java.net
Tue Sep 15 22:59:27 UTC 2020


On Tue, 15 Sep 2020 20:35:12 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> We are in a situation where we have an interface and only one implementation (`CLinker`) - should we just have the
>> latter, and maybe reserve the room to add the general interface at a later time, as we have more implementations?
>> @PaulSandoz - what do you think?  We started off in this direction because we thought that it might have been useful to
>> have different places where to document general foreign linker functionality - as opposed to functionalities that are
>> only applicable to the C linker - but the interface is so general that I'm not sure exactly what we can say at this
>> level.
>
> We also need a comment about sealedness and immutability here

> We are in a situation where we have an interface and only one implementation (`CLinker`) - should we just have the
> latter, and maybe reserve the room to add the general interface at a later time, as we have more implementations?
> @PaulSandoz - what do you think?

Now that i have looked more closely `ForeignLinker` does not seem weighty enough, even though the concepts of
`downcall` and `upcall` are important. I suspect a common super interface could be defined if another kind of linker
becomes a realization, and even then it's not clear to me that would be useful given the following on the `CLinker`:

> * Clients of this API should build function descriptors using the predefined memory layout constants
> * (based on a subset of the built-in types provided by the C language), found in this interface;

which indicates some tighter coupling.

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

PR: https://git.openjdk.java.net/panama-foreign/pull/327


More information about the panama-dev mailing list