Skip to content

Local/global reference management functions#11

Merged
ktoso merged 6 commits into
swiftlang:mainfrom
ktoso:ref-management
Mar 17, 2026
Merged

Local/global reference management functions#11
ktoso merged 6 commits into
swiftlang:mainfrom
ktoso:ref-management

Conversation

@ktoso
Copy link
Copy Markdown
Collaborator

@ktoso ktoso commented Mar 16, 2026

For discussion about having helpers for frame management.

We probably should not "wrap" all interface APIs... however when there si a chance to make usage safer like here about what if the push failed by making a with... method I think it is probably worth it.

Open to opinions though cc @marcprux @madsodgaard

Context is swiftlang/swift-java#616

Copy link
Copy Markdown

@madsodgaard madsodgaard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a great addition.

Only thing I think we should do, is make sure we clear the OOM exception that PushLocalFrame might throw, and throw a Swift error instead.

The alternative is moving this to SwiftJava and using the translatingJNIExceptions helper.

@ktoso
Copy link
Copy Markdown
Collaborator Author

ktoso commented Mar 17, 2026

Added the OOM clearing, good call.

@ktoso ktoso merged commit 9218a76 into swiftlang:main Mar 17, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants