Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jextract: Find ways to minimize string copying when passing Java String to Swift #202

Open
ktoso opened this issue Dec 16, 2024 · 0 comments
Labels
jextract-swift Issues related to jextract-swift

Comments

@ktoso
Copy link
Collaborator

ktoso commented Dec 16, 2024

We could consider if we never escape the Swift string or maybe also look into https://download.java.net/java/early_access/jdk24/docs/api/java.base/java/lang/foreign/Linker.Option.html#critical(boolean) if for some opt-in methods we could avoid copying.

We may also consider another JavaString type which would implement StringProtocol and we would avoid creating a real String in the Swift side which today forces another copy.

@ktoso ktoso added the jextract-swift Issues related to jextract-swift label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jextract-swift Issues related to jextract-swift
Projects
None yet
Development

No branches or pull requests

1 participant