Rename SystemABI to ForeignLinker, and move C support to a separate class. #174
Conversation
- Create 'C' class to hold C constants and ForeignABI factory.
|
Webrevs
|
Looks good - there are few things that need more thinking:
|
Mailing list message from Jorn Vernee on panama-dev:
Why not :) having more freedom to add small C utilities is also a good Jorn |
I was about to mention when I wrote my message that, one counter argument to my proposal was that, if the code used a static import at the top (and you have few examples in your patch) then the code would just use In the end, perhaps this is tied with the support class called just |
The Support suffix is something that we use sometimes in the JDK (e.g. |
Uh, yeah, I just had to do a double take on that I think |
I agree, it doesn't look as weird after applying the rename to CSupport locally. |
Renaming looks good - is there a reason as to why the Cstring was left in place as a test util? If you prefer to address as a followup that's ok with me. |
@JornVernee This change now passes all automated pre-integration checks, type
Since the source branch of this PR was last updated there have been 7 commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge
|
Ah, you were talking about the test util. I was thinking about the CString class that is generated by jextract :) I'd rather address that separately, since I think I have some other ideas w.r.t. Cstring I'd also like to bring up. |
I'll do a rebase and re-run the tests before integrating, just to be sure. |
/integrate |
@JornVernee The following commits have been pushed to foreign-abi since your change was applied:
Your commit was automatically rebased without conflicts. Pushed as commit eebb9a2. |
Hi,
This patch renames SystemABI to ForeignLinker, and moves the C support, namely layout constants and the getSystemABI factory, to a new class named
C
.This is an effort to untangle the otherwise ABI/Language agnostic API of SystemABI from APIs that serve C specifically.
The rename from SystemABI to ForeignLinker attempts to make it clear that there is not a single ABI per system, but there can be multiple. Although the same holds for C, in practice there is one de facto ABI per system, so we still keep the getSystemLinker (renamed from getSystemABI) factory for C.
The new name also better reflects what the class does; it links a native function as a MethodHandle, or links a Java function as a native function pointer. The overall theme being linking.
I've also removed some of the ABI name constants that were in SystemABI previously, as they were unused.
(FYI, the name change in the diff on GitHub from SystemABI -> C seems to have been inferred automatically, and is incorrect. The actual rename is from SystemABI -> ForeignLinker, and the C class was added separately).
Thanks,
Jorn
Progress
Reviewers
Download
$ git fetch https://git.openjdk.java.net/panama-foreign pull/174/head:pull/174
$ git checkout pull/174