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

Maurizio Cimadamore mcimadamore at openjdk.java.net
Wed Sep 16 10:24:40 UTC 2020


On Wed, 16 Sep 2020 10:03:21 GMT, Jorn Vernee <jvernee 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?
>> 
>> 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.
>
> I agree. Thanks for the fresh perspective :)
> 
> CLinker was created as a place to put the C specific documentation, but there's probably no need for different linkers
> to have a common supertype (ForeignLinker). Maybe general doc about what 'linking' means can be put in package-info?

I think putting general linking info in the package-level doc sounds totally the right thing to do.

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

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


More information about the panama-dev mailing list