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

Optional finalizers in kotlin #687

Merged

Conversation

emarteca
Copy link
Contributor

Adding an option (specifiable via the Kotlin configuration file) to allow users to specify that they want to generate finalizer methods to clean up pointers to opaque data, instead of using Cleaners.
This is useful to support older version of the JVM API.

Copy link
Contributor

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

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

LG once tests work

{%- else %}
@Override
@SuppressWarnings("Finalize")
fun finalize() {
Copy link
Contributor

Choose a reason for hiding this comment

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

wait kotlin used to let you just tack on a finalize method? i did not expect it to be that old school.

no wonder it's deprecated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, i think the warning is because it's deprecated now -- you can do the same thing in Java

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I'm familiar with the Java thing I had just almost completely memoryholed it because it's like, something I remember from when I first encountered Java as a kid.

So it was a bit of a throwback seeing this :)

tool/src/kotlin/mod.rs Outdated Show resolved Hide resolved
tool/src/kotlin/mod.rs Outdated Show resolved Hide resolved
@emarteca emarteca marked this pull request as ready for review September 12, 2024 21:27
@Manishearth Manishearth merged commit 8e09751 into rust-diplomat:main Sep 12, 2024
20 checks passed
@Manishearth
Copy link
Contributor

cc @jcrist1

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