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

Jorn Vernee jvernee at openjdk.java.net
Wed Sep 16 10:08:52 UTC 2020


On Tue, 15 Sep 2020 22:56:28 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> 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.

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?

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

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


More information about the panama-dev mailing list